CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Join Date
    Oct 2002
    Posts
    29

    Question Can I use a COM Interface in VB.NET

    As a novice developer someone gave me code and a guide for developing something called a CentralTools module for a product called DrawBrdige Central. It is a COM interface that when compiled to a dll adds a tab to the properties of a DrawBridge Central site. The sample code is all C++ using MFC. I am not ready to conquer C++ programming as I am even still new to VB.NET (I do have over two years experience in VB Scripting for ASP and .VBS files).

    Is there a way to bring the interface defined in C++ code over into VB.NET?

    Thanks,
    Dominic

    If anyone is curious, I can zip up the pdf documentation and the sample files and post them here...

  2. #2
    Join Date
    Jun 2001
    Location
    MO, USA
    Posts
    2,868
    If it's a COM DLL, when you reference it, .NET will automatically create a "wrapper" for it and you can use it just like in VB 6.

  3. #3
    Join Date
    Oct 2002
    Posts
    29
    Actually it started as the code for a COM dll. I can compile it using VS Visual C++ 6.0 IDE. I've even registered the .dll with the system. However, I can't seem to get access to it in VB code. I also need to code the property page look and feel and functionality behind them. Then there are the call-back interfaces I need to somehow use. All the code for these are in C++, I need to understand how to do it in VB instead.

  4. #4
    Join Date
    Oct 2002
    Posts
    29
    OK, here's some more information I was able to gleem from the documentation.

    A CentralTool is an in-porcess COM server packaged as a DLL. CentralTools are implementationsof the ICentralTool interface. A CentralTool communicates with the program using three callback interfaces. The user interface is a standard MFC CPropertyPage (this is what the site admin can use to set specific properties for the add-on).

    So I guess that once the interfaces are all defined by code and a CPropertyPage is designed, then it is compiled into a COM based DLL that is access during run-time by the program.

    I hope this add'l info helps you understand how to help me.

  5. #5
    Join Date
    Oct 2002
    Posts
    29
    Originally posted by DSJ
    If it's a COM DLL
    It becomes a COM DLL after you write all the code for it. Right now it's a bunch of .h and .cpp files defining an interface.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured