0
votes

I am writing a COM DLL in VB.NET 2010(lets call it DLL A). This DLL uses functions in a pre-existing DLL (DLL B). When I run the code from a test app in VS2010 everything works great.

(Test APP) --> (DLL A) --> (DLL B)

Now I add a reference to DLL A in the real APP (in VB6)

(Real APP) --> (DLL A) --> (DLL B)

...and I get this error

Unable to cast COM object of type 'System.__ComObject' to interface typ 'Object.class'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{GUID}' failed due to the following error: No such interface supported (Exception from HRESULT: 0x80004002 (E_NOINTERFACE)).

DLL A does get initialized but as soon as I call a function with a reference to DLL B it Errors out.

HELP!

1
Are you using x86/x64 or both? - rekire
Is DLL B also .NET based or is it old-school COM? - rskar

1 Answers

1
votes

When you deploy .NET DLL and want to use it with COM(VB6) you need to register using "RegASM" with your asembly. You have to include /codebase switch when registering other than GAC folder.

using the /codebase switch, it has to be strong-name assembly.