CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Dec 2006
    Posts
    37

    Thumbs down Include header file "Gdiplus.h" in IDL file

    Hi all,

    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.

    Thanks,
    Bidesh
    Attached Files Attached Files

  2. #2
    Join Date
    Aug 2004
    Location
    Bucharest, Romania... sometimes
    Posts
    1,039

    Re: Include header file "Gdiplus.h" in IDL file

    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,
    Bogdan Apostol
    ESRI Developer Network

    Compilers demystified - Function pointers in Visual Basic 6.0
    Enables the use of function pointers in VB6 and shows how to embed native code in a VB application.

    Customize your R2H
    The unofficial board dedicated to ASUS R2H UMPC owners.

  3. #3
    Join Date
    Dec 2006
    Posts
    37

    Wink Re: Include header file "Gdiplus.h" in IDL file

    Hi Bornish,

    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?

    anyways thanks for your support.

    Bidesh

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