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

ERROR_NO_TOKEN-CreateDispatch fails

65 views
Skip to first unread message

sudhakar

unread,
Sep 9, 2008, 2:01:01 AM9/9/08
to
Hello,

I'm want to use DIAdem 9.x( It's an application) Automation Object in
VC++.but my CreateDispatch returns the Win32 error code (GetLastError) - 1008

Error Details:
**************
GetLastError returns: 1008
Win32 Error Code : ERROR_NO_TOKEN
Description: An attempt was made to reference a token that does not exist.
What does that mean "An attempt was made to reference a token that does not
exist. " ? How can i get this executed ?

But the Automation Object created for "DIAdem.toCommand" succeds in
VBScript ?

Please find the code snippet below.

code snippet:
**************
This is a Win32 COM DLL.
I'm calling the CreateDispatch function in the worker thread,


DWORD dwThreadId;
if((m_hinstance = CreateThread(
0,
0,
appthread,
(LPVOID)this,
0,
&dwThreadId)) == NULL)
{
return S_FALSE;
}


DWORD WINAPI appthread(LPVOID lpParam)
{
COleException *err = new COleException;
_ApplicationApp app;
if( app.CreateDispatch("DIAdem.tocommand", err) == FALSE)
{

// here it fails.
CString f;
f.Format("%u,GetLastError() ");
AfxMessageBox(f);
}



return 0
}

Thanks,
Sudakar

0 new messages