HP LoadRunner Protocol SDK
The CProtocolExtension Class

CProtocolExtension is a singleton. It is instantiated the first time a reference is made to CProtocolExtension::Instance() and can be accessed at any point in the protocol implementation. CProtocolExtension manages protocol internal issues such as event handling, and also handles registration in the LoadRunner execution environment. It also provides protocol services such as logging, data point generation, and so on.

See CProtocolExtension Class Reference

One of the important services CProtocolExtension provides is the ability to save strings to LoadRunner parameters. The advantage of using LoadRunner parameters is that the user does not have to manage memory buffers allocated to string values (see SaveStringToParameter below).

The following are other services provided by CProtocolExtension:

Usage examples of CProtocolExtension
Copy Code
CMyVirtualUserData* myData = (CMyVirtualUserData*)CProtocolExtension::Instance()->GetVirtualUserData();
CProtocolExtension::Instance()->CreateDataPoint("CONNECT", 1.0);
CProtocolExtension::Instance()-> LogErrorMessage(ECHO_INTERNAL_ERROR, "Failed to create socket");
CProtocolExtension::Instance()->SetVirtualUserData(myData);