strange persistence problem

Dave Mason dmason____transat-tech.com
Thu Sep 26 21:53:22 CEST 2002


Hi,
I have a problem where the syntax of an object appears to change after 
the persistence data is read in.  Here is a code fragment from 
agent.cpp.  In the MIB, wsSeqNum has SYNTAX Unsigned32, DEFVAL 0. 
 AgentGen Pro appears to translate this to Gauge32.

    // add supported objects
    init(*mib);
    // add user modules
    module_init(mib);

    int rc;
    unsigned long seqNum;
    rc = wsSeqNum::instance->get_value(seqNum);
    // load persitent objects from disk
    mib->init();
    rc = wsSeqNum::instance->get_value(seqNum);

The first get_value works fine, leaving seqNum with the initial default 
value of 0.  The return code rc is 0.  However, after the mib->init(), 
the same get_value fails because it now thinks the object syntax is a 
signed integer.  The return code is -10.  Interestingly enough, the 
second get_value works if I delete the persistence data files.  Any ideas?

Regards,
Dave





More information about the AGENTPP mailing list