Difference between revisions of "RPC HELP DLL GuideLines C Destroy Broker Components"

From VistApedia
Jump to: navigation, search
 
 
Line 2: Line 2:
  
 
[[RPC_HELP_Other_DLL_Interface_List|DLL Interface Home]]
 
[[RPC_HELP_Other_DLL_Interface_List|DLL Interface Home]]
 +
<h2>C: Destroy Broker Components</h2>
 +
When you are done using any [[RPC_HELP_TRPCBroker|TRPCBroker]] component, you should call its destroy method to free it from memory.
 +
 +
To destroy [[RPC_HELP_TRPCBroker|TRPCBroker]] components from your C program:
 +
 +
'''1.''' Make sure the [[RPC_HELP_TRPCBroker|TRPCBroker]] component is not connected:
 +
 +
    RPCBPropSet(RPCBroker, "Connected", "0");
 +
 +
''2.'' Call the [[RPC_HELP_DLL_ExportFN_RPCBFree|RPCBFree]] method to destroy the object:
 +
 +
    // Destroy the RPCBroker component instance.
 +
    RPCBFree(RPCBroker);
 +
 +
'''3.''' When you have destroyed all [[RPC_HELP_TRPCBroker|TRPCBroker]] components, but before your application terminates, you should call the Windows API FreeLibrary function to unload the DLL:
 +
 +
    FreeLibrary(hLib);

Latest revision as of 16:16, 8 July 2015

RPC Broker Help Home

DLL Interface Home

C: Destroy Broker Components

When you are done using any TRPCBroker component, you should call its destroy method to free it from memory.

To destroy TRPCBroker components from your C program:

1. Make sure the TRPCBroker component is not connected:

   RPCBPropSet(RPCBroker, "Connected", "0");

2. Call the RPCBFree method to destroy the object:

   // Destroy the RPCBroker component instance.
   RPCBFree(RPCBroker);

3. When you have destroyed all TRPCBroker components, but before your application terminates, you should call the Windows API FreeLibrary function to unload the DLL:

   FreeLibrary(hLib);