To connect to the OPC client under the widest possible set of DCOM configurations, the program should call the following function as soon as it starts up and before it opens any DCOM connections. The syntax provided is for C++/C#, and must be modified accordingly for different languages.
// Immediately after calling CoInitializeEx ()
// Allow anyone to be able to call back into us!
CoInitializeSecurity (NULL, -1, NULL, NULL, RPC_C_AUTHN_LEVEL_NONE, RPC_C_IMP_LEVEL_IMPERSONATE, NULL, EOAC_NONE, NULL);
Note: This function is recommended if the program contains an ActiveX OPC client control.