To lean about interfaces, I’m trying to write a test project to implement the IDispatch interface.
So far I’ve:
- created an MFC dll project in visual studio 2010
-
written the following IDL
[ uuid(68B0FAE7-3828-415D-94B0-720A007311FF), version(1.0) ] library Test { importlib("stdole32.tlb"); importlib("stdole2.tlb"); [ uuid(DD35D282-ABEF-4411-B3D1-B4FD848516A5) ] interface _Test : IDispatch { }; };
Created a C header file called Test.h but I’m wandering how I declare this to be linked to the IDL. Any help or hello world tutorials would be great. Thanks
You can you the
midl compiler
It is capable of generating header/sources in c (or C++? don’t remember), but most importantly it will get you a typelibrary (tlb) file
#import directive
Will generate c++ definitions for the typelibrary contents.