阅读:1970回复:0
高手帮忙解决!~急!~!SNMP对话框应用
在MFC的对话框中,对应Button中 加入
Snmp::socket_startup(); // Initialize socket subsystem //---------[ make a GenAddress and Oid object to retrieve ]--------------- UdpAddress address("172.16.30.4"); // make a SNMP++ Generic address if ( !address.valid()) { // check validity of address } Oid oid("1.3.6.1.2.1.3.0"); // default is sysDescr if ( !oid.valid()) { // check validity of user oid } //---------[ determine options to use ]----------------------------------- snmp_version version=version1; // default is v1 int retries=3; // default retries is 1 int timeout=100; // default is 1 second u_short port=161; // default snmp port is 161 OctetStr community("public"); // community name #ifdef _SNMPv3 OctetStr privPassword(""); OctetStr authPassword(""); OctetStr securityName(""); int securityModel = SecurityModel_USM; int securityLevel = SecurityLevel_authPriv; OctetStr contextName(""); OctetStr contextEngineID(""); long authProtocol = SNMPv3_usmNoAuthProtocol; long privProtocol = SNMPv3_usmNoPrivProtocol; v3MP *v3_MP; #endif //----------[ create a SNMP++ session ]----------------------------------- int status; // bind to any port and use IPv6 if needed *Snmp snmp(status, 0, (address.get_ip_version() == Adress::version_ipv6)); 会在*这个位置报 Unhandled exception at 0x7c958fea in Manage.exe: 0xC0000005: Access violation writing location 0x00000010. 然后跳出 求高手帮忙解决!~网上急等!~! |
|