Interop different depending on how component is started

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: Steven Kilby (spam_at_nowhere.com)
Date: 12/23/04


Date: Wed, 22 Dec 2004 20:06:21 -0800

I have a component (inproc dll) written in VB6. I have a client written in
C#. If I compile the component to native code everything works fine. I add
the necessary type library for my component to the C# project and everything
compiles and runs. I can debug both the C# code and the VB code in the
VS.NET IDE.

Now, on occasion, I would like to debug the VB code in the VB6 IDE and the
C# code in the VS.NET IDE. I tell the VB6 project to "Wait for component
creation" and start the project. Then, I start the C# application from its
IDE.

Here is the problem. When the component is started in the VB6 IDE the type
library previously registered for the component.dll file is replaced with a
new type library that refers to the component.vbp file. The type library
version is the same so the VS.NET sees the change and recompiles the C#
project before starting the application. The compilation fails because the
Interop layer generated by .NET for the VB component doesn't create
GetEnumerate() for the collections.

The Interop layer generated for the type library from the native compiled
DLL file does have GetEnumerate() for the collections. Bear in mind I can
reproduce this at will and there are no code or project changes. The only
difference is whether the type library is from the dll file or the one put
in place when the component is started from the IDE.

Does anyone have a clue as to what is going on?

Thanks
Steven



Relevant Pages

  • Re: VBA and VSTO
    ... If you compile in VB6 with Global MultiUse than all you have to do is set a reference in Excel to your dll via Tools, References and you can access your functions in the dll directly. ... You will have to register the dll as well with Windows with Regsvr32, but that can be done quite simply in VBA. ...
    (microsoft.public.excel.programming)
  • Interop different depending on how component is started
    ... I have a component written in VB6. ... If I compile the component to native code everything works fine. ... VS.NET IDE. ... DLL file does have GetEnumeratefor the collections. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Solution Build question / issue....
    ... Both compiles are in Release mode, IDE and command line. ... What we did is in the Support DLL there are three calls to the HTTPContext ... compile from the IDE the variables do get set. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Newbie Simple Quick Question
    ... First of all you should really be asking this question in a VB6 newsgroup. ... You seem to be asking if a compiled code (the Dll) can execute uncompiled code. ... This should allow you to reference a named datasource and change the definition of that datasource externally to your program. ... having the class it is looking for or once you compile the code ...
    (microsoft.public.dotnet.languages.vb)
  • Re: COM Automation error - finding out which interface failed
    ... main EXE and DB accessed DLL in the same IDE Mike -- we do that all the time ... The IDE cannot debug ... does not support expected interface" runtime error when running a VB6 ...
    (microsoft.public.vb.winapi)