Platform SDK: Network Management

WinSNMP Programming Tasks

The following table summarizes the basic programming procedures that you must perform to code a WinSNMP application, and the topics that provide information about these tasks.

Programming task Task-related function and topics
Open the WinSNMP application. Use SnmpStartup.

See Opening and Closing a WinSNMP Application.

Open one or more WinSNMP sessions. Use SnmpCreateSession.

See Opening and Closing a WinSNMP Session.

Register to receive traps or notifications. Use SnmpRegister.

See Managing Traps and Notifications.

Create one or more variable binding lists for incorporation in a PDU. Use SnmpCreateVbl, SnmpDuplicateVbl, SnmpSetVb.

See Working with Variable Binding Lists.

Note: The application may need to call other variable binding functions to create the variable binding list.

Create one or more PDUs for transmission and processing. Use SnmpCreatePDU, SnmpSetPduData, SnmpDuplicatePDU.

See Working with Protocol Data Units.

Note: The application may need to call other PDU functions and WinSNMP utility functions to create the PDU.

Submit one or more SNMP operation requests. Use SnmpSendMsg.

See Sending SNMP Messages.

Retrieve the response to the SNMP operation request. Use SnmpRecvMsg.

See Receiving SNMP Messages.

Process the request response. Use application-specific logic.
Close each WinSNMP session. Use SnmpClose.

See Opening and Closing a WinSNMP Session.

Close the WinSNMP application. Use SnmpCleanup.

See Opening and Closing a WinSNMP Application.


The following topics contain additional information about other general programming concepts specific to the WinSNMP environment.

General programming tasks Managing Object Identifiers

Freeing WinSNMP Descriptors

Setting the Entity and Context Translation Mode

Managing the Retransmission Policy

Writing WinSNMP Applications with Multiple Threads

Registering an SNMP Agent Application


In addition, the WinSNMP application may need to incorporate calls to the following WinSNMP functions: SnmpFreeVbl, SnmpFreeEntity, SnmpFreeDescriptor, SnmpFreeContext, and SnmpFreePdu. This enables the Microsoft WinSNMP implementation to free WinSNMP memory objects. As a general rule, the WinSNMP application should free all resources allocated as the result of a call to a WinSNMP function. For additional information about deallocating resources, see Allocating WinSNMP Memory Objects.