kOBL_ExpectedBONotFound Exception

Ruslan Zasukhin sunshine at public.kherson.ua
Wed Oct 22 21:30:26 CDT 2003


on 10/22/03 21:14, James Clark at wjamesclark at comcast.net wrote:

Hi James,

> We see this exception (Base Object Not Found) get thrown on a sporadic basis.
> Can you tell us what would typically cause
> this exception to be thrown?  It seems only to happen when the application is
> running outside the debugging environment.  If we
> step through the application in the debugger, we never see the problem.

Very good.

Below you see function that throw this error.

This means that you have change your VDK classes in YOUR application,
But after this change try to open OLD database where there is no that
changes.

You simply need to trash the old db, and create new db that have that
changes.
This problem can happens only during your development process.


void VDK_DataBase::Create_VDK_BaseObjects( void )
{
    OBL_BaseObject* pOBL_BaseObject;
    VDK_BaseObject* pVDKobject;

    // FBL have create internal BaseObjects and their fields,
    // so we must set pointers of VDK C++ objects to the FBL objects,
    // i.e link VDK wrapper to OBL kernel.
    
    // Note: this loop is for static domain only.
    // so objects created from database are coresponded to the objects
    // created by C++ developer, we get them from mObjects array.
    ulong Objects = mObjects.GetCount();
    for( ulong i = 1; i <= Objects ; i++ )
    {
        VDK_BaseObject* theBaseObject = GetBaseObject( i );
        const char*     theName       = theBaseObject->GetName();
                
                
        theBaseObject->mObjectImp =  mDataBaseImp->GetBaseObject(
(char*)theName );
        if( theBaseObject->mObjectImp == NULL ) // object not found in
database.
            throw xOBL_ExpectedBONotFound();

        // manually link mID field.
        theBaseObject->mRecID->mFieldImp =
theBaseObject->mObjectImp->GetTopTable()->GetKEY();

        // Now in the loop link
        ulong Fields = theBaseObject->GetFieldCount( kFBL_All );
        for( ushort  k = 1; k <= Fields ; k++ )
        {
            VDK_Field* theField = theBaseObject->GetField( k );
            
            if( theField == NULL )
                throw xOBL_ExpectedFieldNotFound();
            
            const char* FieldName = theField->GetName();
            
            theField->mFieldImp = theBaseObject->mObjectImp->GetField(
FieldName );
            if( theField->mFieldImp == NULL )
                throw xOBL_ExpectedFieldNotFound();
        } 
    }     



-- 
Best regards,
Ruslan Zasukhin      [ I feel the need...the need for speed ]
-------------------------------------------------------------
e-mail: ruslan at paradigmasoft.com
web: http://www.paradigmasoft.com

To subscribe to the Valentina mail list go to:
http://lists.macserve.net/mailman/listinfo/valentina
-------------------------------------------------------------



More information about the Valentina mailing list