Click to See Complete Forum and Search --> : How to create C++ - classes and methods from *.idl files ?


June 11th, 1999, 03:37 AM
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

lundgren
June 13th, 1999, 07:27 PM
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.

June 17th, 1999, 03:47 PM
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.