locked
C# .dll - VB6 .exe interop RRS feed

  • Question

  • I have a .dll (written in C#) that's used by an executable written in VB6. At one point, however, I need to display a form in the native .exe, but the request originates in my managed .dll. My current approach is to use kernel32's LoadLibrary(...) to load the .exe in the .dll, followed by GetProcAddress(...) to get the address of the VB6 sub in the .exe, then call the sub with the help of another auxilliary .dll, written in Assembly, providing a way to jump to the address returned by GetProcAddress(...).

     

    By the way, the native .exe is built after the managed .dll in the build process (and the order can't be changed), so I can't use the tlbimp/interop assembly approach.

     

    Is there a better way to do this? (There must be...)

    Friday, May 9, 2008 5:47 AM

Answers

  • Raise an event in the .dll and handle it in the exe.  Look at the Interop Forms Toolkit.

     

    Friday, May 9, 2008 8:16 AM

All replies

  • Raise an event in the .dll and handle it in the exe.  Look at the Interop Forms Toolkit.

     

    Friday, May 9, 2008 8:16 AM
  • I have pretty much the same issue.

    My app is VB6 and calls a VB.net dll that makes use of interop forms.

    I would like to call a vb6 Function
    Do I have an alternative to RaiseEvent?
    Is there a way to call the vb6 function directly from .net.

    Thanks,

    Helen
    Tuesday, June 3, 2008 2:44 PM