I have static lib which i want to convert into COM DLL. so have write an IDL file.
In this IDL file i have to define a structure which contains another structure COLOR which is defined in "Gdiplus.h".
My question is whether i can add this header file "Gdiplus.h" in the IDL file?
If yes then how. note that after including the "Gdiplus.h" i have mention its namespace also which is Gdiplus.
I have done it by including #import "Gdiplus.h" but error such as this is generated
C:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Include\Gdiplus.h(25) : error MIDL2025 : syntax error : expecting an interface name or DispatchInterfaceName or CoclassName or ModuleName or LibraryName or a type specification near "namespace"
I am attaching the IDL file too for your reference...
Can anyone help me.
I believe you cannot / shouldn't include a C / C++ header file in an IDL. If the only thing you need from "Gdiplus.h" is a structure like COLOR, then you should define it in the IDL as COM interface, without including other IDLs.
Regards,
Structure COLOR is not only my requirement. rather i have to including many structures COLOR, TEXT and so on.
So what i did, I changed the function declaration to BYTE * for in and out parameters.
And in the implementation file i typecast them to my requirement. But there is again a problem... that is the client have to typecast every parameter which are user defind structire to BYTE*, may it be in or out parameter. this scheme is not realy desired.
Is there no way? if i give u the structures i want to define in the IDL file can you help me?
* The Best Reasons to Target Windows 8
Learn some of the best reasons why you should seriously consider bringing your Android mobile development expertise to bear on the Windows 8 platform.