CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Jul 2001
    Location
    jordan
    Posts
    63

    COM with MFC for VB programs

    hi
    I'm trying to create objects or structs in a DLL or OCX that can be seen by Visual Basic programs.

    ---These objects will be created by VB programs using either keyword New or CreateObject.

    ---The objects will be passed as parameters to functions inside the DLL/OCX.

    ---The objects will be returned by functions from the DLL/OCX.

    Where should I be reading? Can anyone provide a simple sample
    project?

    P.S. I'm trying to avoid OLE and Variants if possible.

    thank you

    awni

  2. #2
    Join Date
    Apr 2004
    Posts
    76
    Hi awni,

    I find the ATL project the easiest.

    You can run the DLL under the debugger. When prompted, choose VB as the executable. Start a new project under VB.

    The class Wizard makes it very easy to add methods.

    The books I use on COM are Box's essential com, and a book on power VB (I don't recall by whom). The later book goes into detail how VB uses the COM objects, and little nuances such as BSTR conversions going on between the object and VB.

    Jeff

  3. #3
    Join Date
    Jul 2001
    Location
    jordan
    Posts
    63
    I've been told to go with ATL, I found a few articles(which i have not read yet)
    here on codegure, i wonder if they're what i need, this one looks promising, not sure though..

    http://www.codeguru.com/Cpp/COM-Tech...cle.php/c3565/
    entitled
    ATL DISPID Encoding.

    Can you tell from the title if it's what I need?


    thanks

    awni

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