Please forgive me if this question is stupid but I just started coding again
so my skills are a bit rusty. I am accessing the reply mib list as follows:

  TSNMPMib *tempMIBptr ;
  String tempString,tempOID;

tempMIBptr = new TSNMPMib;

  for (i=0; i < SNMPInterfaceptr->Reply->MIBCount(); i++)
  {
    tempMIBptr = SNMPInterfaceptr->Reply->MIBByIndex(i);
    tempOID = tempMIBptr->OID;
    tempString = tempMIBptr->Value;
  }

delete tempMIBptr;

and on the next SNMP get reply I get an access violation. Does the
MIBByIndex() return a pointer to a TSNMPMib object? I ask this because I am
not familure with the pascal syntax for functions but if I change the code
to:

TSNMPMib *tempMIBptr ;
  String tempString,tempOID;

  for (i=0; i < SNMPInterfaceptr->Reply->MIBCount(); i++)
  {
    tempMIBptr = SNMPInterfaceptr->Reply->MIBByIndex(i);
    tempOID = tempMIBptr->OID;
    tempString = tempMIBptr->Value;
  }

It stops crashing.

Thanks.

Jeff


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
synalist-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/synalist-public

Reply via email to