edimetia3d/OPC-Client-X64

Remote connect problem

mzillgith opened this issue · 3 comments

Hi,
I have a problem connecting to the Matrikon simulation server with the OPCClientDemo. The local connect works fine but the remote connect doesn't work. After showing the remote servers correctly and selecting the desired server the function GetCLSIDFromRemoteRegistry fails. It seems the RegQueryValueEx call returns only garbage and the CLSIDFromString call fails. Then later throwing an exception in makeRemoteObject.

Does anybody have an idea what might be the reason? From wireshark it seems that the remote registry access works.

I wonder why the remote registry access is required at all. When using some other clients (e.g. Softing demo client) the connection works also without using remote registry. I guess they are using the OpcEnum.exe for getting the clsid?

I have not yet figured out why the remote registry access doesn't work. But I refactored the code so that the connectDAServer call can now be called using the CLSID directly and added a method to get the CLSID by using the CLSIDFromProgID call of IOPCServerList. This way the remote registry service is not required and the OPC means are used instead of accessing the registry directly.

See our solution: dontsovcmc@29090df#diff-fa9728931b02835223e8215008ea12f9R77

We call CoCreateInstanceEx with athn.dwAuthnLevel = RPC_C_AUTHN_LEVEL_NONE; if RPC_C_AUTHN_LEVEL_CONNECT error