المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : System.InvalidCastException Query



C# Programming
01-16-2010, 11:40 AM
Hi,
I am passing a VBScript Object to a C# assembly and am getting the following error output:

"Unable to cast COM object of type 'Agents.AgentClass' to interface type 'Agents._Agent'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{315DF678-45D7-4A60-9A50-C9E83672A5E5}' failed due to the following error: No such interface supported (Exception from HRESULT: 0x80004002 (E_NOINTERFACE))."

I'd appreciate it if someone can explain what is going on here and how I can fix it? I am confused...

Note: I have tried changing the method header to accept type Agents._Agent but that causing the method call in vbscript to fail completely. Changing the type to Agents.Agent (another available type) generates a similar error.


Kind Regards,
Dave

Regards,
Dave