QueryInterface failed - InvalidCastException
From: Kemal Eginci via DotNetMonster.com (forum_at_DotNetMonster.com)
Date: 12/02/04
- Next message: Emmanuel: "Re: Creating an Excel Automation Add-In using C#"
- Previous message: Paul Clement: "Re: Creating an Excel Automation Add-In using C#"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 02 Dec 2004 15:17:45 GMT
Hi,
We have a Data Integration application (IA) which is working in a lot of sites.
The program is doing some integration tasks between our database and another software company database which is called XXX. It has been perpared with C# - VS 2003 on SQL Server.
We don't have direct access through the XXX database. We have to use their COM objects with a signature they gave us. We have made .NET objects with tblimp.exe. It has been working for 4-5 months. In the past sometimes it has given an System.InvalidCastException error. When we got this error, we simply re-install their application to refresh their COM objects and this was working
In the last 1-2 weeks, almoust every site we have has a same problem. When we install our new version of IA we have this errors:
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.InvalidCastException: QueryInterface for interface CESGroupManInterface.IrboMember failed.
at Bromcom.Data.Transfer.SimsSQL.CESGroupMan.rboMemberClass.Browse(Int32 iSignature, Int32 iGroupID, Object dtFrom, Object dtTo, Int32 iRole, Recordset& rsErrors)
--- End of inner exception stack trace ---
at System.Reflection.RuntimeMethodInfo.InternalInvoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean isBinderDefault, Assembly caller, Boolean verifyAccess) at System.Reflection.RuntimeMethodInfo.InternalInvoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean verifyAccess) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) at Bromcom.Data.Transfer.Support.MethodResolver.Invoke(Object instance, Object[]& values) at Bromcom.Data.Transfer.Support.RequestHandler.Process(Object[]& values)
And the weird thing is I got this error in run time while i can execute it in the VS 2003. In the debug mode there is no problem i mean. And this is the code lines for calling .net objects whic has been made from COM objects with:
----------------
Signature signature = SignatureServer.GetInstance().GetSignature();
ADODB.Recordset adoErrors_single = new ADODB.Recordset();
ADODB.Recordset adoResults_single = null;
CESGroupManInterface.IrboMember members = (CESGroupManInterface.IrboMember)new namespace.CESGroupMan.rboMemberClass();
----------------
CESGroupManInterface (interface) and Namespace.CESGroupMan .net objects are objects we have after executing tblimp.exe for the COM object CESGroupMan.dll
We have also same problem when we just using the Namespace.CESGroupMan .net object instead of using it with its interface object.
We have a strong suspicion about ADODB dll, because the com object uses 2.5.0.0 version of adodb and error description has ?System.InvalidCastException: QueryInterface for interface CESGroupManInterface.IrboMember failed.? Text.
So I have downloaded csrepair.exe for repairing the adodb registery. This exe sometimes
Works, sometimes doesn?t. !!?? The other solution is re-installing the other software company product to regenerate the registery and this also sometimes work J
This is very serious problem we have any helpful response will be appreciated.
Kemal
-- Message posted via http://www.dotnetmonster.com
- Next message: Emmanuel: "Re: Creating an Excel Automation Add-In using C#"
- Previous message: Paul Clement: "Re: Creating an Excel Automation Add-In using C#"
- Messages sorted by: [ date ] [ thread ]