If the project is valid it should work anyway.
cbProject::GetFileCount() returns an int, but as I just saw the internally used filelist (declared with WX_DECLARE_LIST) uses size_t as return-value (at least in wxWidgets 2.8.10), so it might lead to an error if you have really very, very much files in a project.
Nevertheless it works here (actual trunk), if I use project-managers GetActiveProject() to fetch a project, no difference if it is a small test-project (12 files ) or a larger one (linux-kernel as test-project with more than 21000 files).