Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Help! How to use CoCreateInstanceEx() connect with a remote server from WinCE.

220 views
Skip to first unread message

Zhong Hui

unread,
Apr 15, 2002, 11:35:34 AM4/15/02
to
I'd like to connect with an OPC server on Win2000 or NT
from an OPC client on WinCE v3.00.
The tool is Microsoft Windows CE platform Builder V3.00, I
can ping NT and CE each other and have registered the OPC
Server on NT only.

On CE, I try to run:

COSERVERINFO si;
MULTI_QI qi;
CLSID clsid;
wchar_t *clsid_str = L"{8ECC055D-047F-11D1-A537-
0000F8753ED1}";
// This OPC server has been registered on NT,
// but has not been registered on CE.

hr = CLSIDFromString(clsid_str, &clsid);

si.pwszName = L"188.111.10.104";
//IP address of remote server
si.pAuthInfo = NULL;
si.dwReserved2 = 0;

qi.pIID = &IID_IUnknown;
qi.pItf = NULL;
qi.hr = 0;

CoInitialize(0);
hr = CoCreateInstanceEx(clsid, NULL,
CLSCTX_REMOTE_SERVER,
&si, 1, &qi);

it return error: hr = 0x80070057 (Invalid argument), I
have no idea how to fix it now.
I need your help, thank you very much.

Paul G. Tobey

unread,
Apr 15, 2002, 12:18:19 PM4/15/02
to
Have you registered a proxy for the remote object on the Windows CE device?

Paul T.

"Zhong Hui" <zhh...@hotmail.com> wrote in message
news:237801c1e493$2eec5450$a5e62ecf@tkmsftngxa07...

0 new messages