cbEditor* ed = Manager::Get()->GetEditorManager()->GetBuiltinActiveEditor();
if (ed)
{
// make sure it is saved
ed->Save();
file.Assign(ed->GetFilename());
}
// Now activate the project this file belongs to
ProjectFile* pf = ed->GetProjectFile();
Oh, I seemed to do something stupid when building CB. I had set a wrong compiler setting and linked a library that isn't needed, and that error was in that module. After I removed it, CB can start correctly.