CTSession::GetNextActive() retrieves a database object pointer of the next active database. When no more active database exist, CTSession::GetNextActive() returns NULL.
// Display all active databases
void DisplayActiveDatabases(CTSession &ASession)
{
VRLEN hScan;
CTDatabase* pDatabase;
if ((pDatabase = ASession.GetFirstActive(&hScan)) != NULL)
{
do
{
printf("Database: %s Path: %s\n", pDatabase->GetName().c_str(),
pDatabase->GetPath().c_str());
hDatabase = ASession.GetNextActive(&hScan);
}
while (pDatabase != NULL);
}
}