dcsimg
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4

Thread: Basic COM learner

  1. #1
    Join Date
    May 2008
    Posts
    36

    Basic COM learner

    Hello,

    I have a typelibrary AAA.tlb file and its compiled into AAA.tlh and AAA.tli
    Within the header file I see its defined coclass as

    struct CoClassAAA;

    put in a namespace NS_AAA.


    I do the following in my OnInitDialog

    CoInitialize(NULL);
    CLSID
    HRESULT hr=CLSIDFromProgID(OLESTR("AAA.CoClassAAA"),&clsid);

    But during debug hr value contains 0x800401f3 which is an invalid class string and clsid is NULL
    I have no idea how to find out the correct class string to pass in for the given library.

    Thank you,

  2. #2
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    19,624

    Re: Basic COM learner

    Quote Originally Posted by ChayKieu View Post
    I do the following in my OnInitDialog

    Code:
    CoInitialize(NULL);
    CLSID
    HRESULT hr=CLSIDFromProgID(OLESTR("AAA.CoClassAAA"),&clsid);
    This code cannot be compiled. Please, show your actual code.
    Victor Nijegorodov

  3. #3
    Join Date
    Oct 2002
    Location
    Timisoara, Romania
    Posts
    14,360

    Re: Basic COM learner

    You should take a look at this article: Introduction to COM - What It Is and How to Use It.
    Marius Bancila
    Home Page
    My CodeGuru articles

    I do not offer technical support via PM or e-mail. Please use vbBulletin codes.

  4. #4
    Join Date
    Nov 2000
    Location
    Voronezh, Russia
    Posts
    6,607

    Re: Basic COM learner

    struct CoClassAAA;

    put in a namespace NS_AAA.
    CLSID in your case is __uuidof(NS_AAA::CoClassAAA).
    Best regards,
    Igor

Posting Permissions

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


Windows Mobile Development Center


Click Here to Expand Forum to Full Width




On-Demand Webinars (sponsored)