minimum implementation for smtp-set

"Nölle, Jochen" jochen.noelle____accellence.de
Fri Jun 21 17:23:26 CEST 2002


Hello,

could someone tell me what code implementation has to be done to set a
variable from a management system in an agent++ application?
I tried to implement a small piece of code using MS Visual C++6.0.
Snmp-get works but if a set-pdu has been received the application
crashes in 
function "void MibLeaf::replace_value(SnmpSyntax* v)" in the
delete-function. VC++ says "HEAP[AgentppTest.exe]: Invalid Address
specified to RtlValidateHeap( 310000, 89a980 )".

Previously I compiled a mib-class "my_test_mib" with the agentgen-tool
containing an octet-string and an integer value.

This is the code:
--------------------
 Mib mib;
 int status;
 Snmpx snmp(status, 163);

 if(status !=SNMP_CLASS_SUCCESS)
 {
	return FALSE;
 }
 RequestList ReqList;

 mib.set_request_list(&ReqList);
 mib.add(new my_test_mib); 
 ReqList.set_snmp(&snmp);
	for(;;)
	{
		req = ReqList.receive(30);

		if(req)
			mib.process_request(req);
	}
	return TRUE;  // return TRUE  unless you set the focus to a
control
--------------------

In my opinion, it is hard work for a newcomer, who just makes first
steps working with snmp trying to make agent++ work because of missing
introduction to the package. The example code comes with no explanation
about its functionality. 

Could someone give me some help?

Thanks, 

Jochen Noelle



More information about the AGENTPP mailing list