none
Mimicking a VB6 COM class interface in .NET RRS feed

  • Question

  • Hello,
    I currently have a COM DLL written in VB6 that exposes a few classes/methods.

    I would like to create a new .NET DLL that is a binary-compatible drop-in replacement for the VB6 DLL.

    Is such a thing possible?

    Can I accomplish this (or something similar) by having a .NET DLL with equivalent public classes/methods and manually define the GUID and ClassIDs as the same as those in the VB6 DLL?

    If so, is there an easy way to export the interface (class and method defs) from a VB6 DLL into a new .NET project with stubs for each class/method?

    Thanks for any ideas and insight.
    Friday, March 13, 2009 8:05 PM

Answers

  • Yes that should be possible in most cases. You just have to kkep track of all the GUIDs and make sure you specify the same in your managed code. I don't know any tool that can do all the work for you though. 
    Mattias, C# MVP
    Monday, March 23, 2009 10:01 AM
    Moderator
  • Hello Daniel

    Please refer to the VBDllCOMServer example in All-In-One Code Framework (CodeFx). This is the skeleton of writing a COM dll in VB.NET. You can manually define the equivalent classes/methods and the GUIDs in it. Read ReadMe.txt for the detailed creation steps.

    Let me know if you have any feedback for the examples in CodeFx.

    Thanks
    Jialiang Ge
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
    Friday, April 3, 2009 3:44 AM
    Moderator

All replies

  • Yes that should be possible in most cases. You just have to kkep track of all the GUIDs and make sure you specify the same in your managed code. I don't know any tool that can do all the work for you though. 
    Mattias, C# MVP
    Monday, March 23, 2009 10:01 AM
    Moderator
  • Hello Daniel

    Please refer to the VBDllCOMServer example in All-In-One Code Framework (CodeFx). This is the skeleton of writing a COM dll in VB.NET. You can manually define the equivalent classes/methods and the GUIDs in it. Read ReadMe.txt for the detailed creation steps.

    Let me know if you have any feedback for the examples in CodeFx.

    Thanks
    Jialiang Ge
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
    Friday, April 3, 2009 3:44 AM
    Moderator
  • i know this is an old thread, but I have a need to accomplish the same thing ... were you ever successfull with this? 
    Tuesday, February 2, 2010 12:18 AM