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

    How to create C++ - classes and methods from *.idl files ?

    Hi,
    I'm just starting with COM and I don't know how to use e.g. "mshtml.idl" to create C++ classes of it.
    I know there is a 'midl'-compiler. But how is it integrated in VC++ 6 ?
    I scanned the help files but didn't find a solution.
    Anybody can give me some hints ?

    Thanks in advance.
    Dan



  2. #2
    Join Date
    Jun 1999
    Posts
    2

    Re: How to create C++ - classes and methods from *.idl files ?

    Your on the right track. Use the midl compiler to create a TBL file, then use the #import declaration to create the wrapper _Ptr class.


  3. #3
    Guest

    Re: How to create C++ - classes and methods from *.idl files ?

    Run midl.exe from command line and pass .idl file. midl.exe should be in Visual Studio's VC\Bin directory. That will generate a tlb ( type library ) file. Use #import .... tlb. It will add .tlh (type library header ) and .tli (type library implementation ) files.



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