digitalmars.D.learn - Win32 to D
- nomad (12/12) Nov 08 2009 I would like to use the following Win32 function in D:
- Stewart Gordon (18/32) Nov 08 2009 From what I can make out, the equivalent D1 declaration is probably
- nomad (5/43) Nov 08 2009 Thanks Stewart. You are correct this is one of the many GDI+ functions I...
- Frank Benoit (2/18) Nov 08 2009 FYI, there is GDI+ in DWT, see dwt-win\dwt\internal\gdip\
- nomad (3/22) Nov 08 2009 I had no idea it already existed but since I've already got all structur...
I would like to use the following Win32 function in D: GpStatus WINGDIPAPI GdipEnumerateMetafileSrcRectDestPointI( GpGraphics * graphics, GDIPCONST GpMetafile * metafile, GDIPCONST Point & destPoint, GDIPCONST Rect & srcRect, Unit srcUnit, EnumerateMetafileProc callback, VOID * callbackData, GDIPCONST GpImageAttributes * imageAttributes ); what is the proper way to do so?
Nov 08 2009
nomad wrote:I would like to use the following Win32 function in D: GpStatus WINGDIPAPI GdipEnumerateMetafileSrcRectDestPointI( GpGraphics * graphics, GDIPCONST GpMetafile * metafile, GDIPCONST Point & destPoint, GDIPCONST Rect & srcRect, Unit srcUnit, EnumerateMetafileProc callback, VOID * callbackData, GDIPCONST GpImageAttributes * imageAttributes ); what is the proper way to do so?From what I can make out, the equivalent D1 declaration is probably extern (Windows) GpStatus GdipEnumerateMetafileSrcRectDestPointI( GpGraphics* graphics, GpMetafile* metafile, ref Point destPoint, ref Rect srcRect, Unit srcUnit, EnumerateMetafileProc callback, void* callbackData, GpImageAttributes* imageAttributes ); The equivalent D2 declaration would add a few consts here and there. But without seeing how WINGDIPAPI and GDIPCONST are defined, I can't be sure. Since a quick search reveals that this is a GDI+ function, I've changed the subject line to make it clearer. I presume you have the required libs? Stewart.
Nov 08 2009
Stewart Gordon Wrote:nomad wrote:Thanks Stewart. You are correct this is one of the many GDI+ functions I have been trying to port to D. I do not have the libs but was hoping to convert them from generate them from DLLs once I am done, unless of course someone is generous enough to offer them. The definition of the to constants are as follows: #define GDIPCONST const #define WINGDIPAPI __stdcallI would like to use the following Win32 function in D: GpStatus WINGDIPAPI GdipEnumerateMetafileSrcRectDestPointI( GpGraphics * graphics, GDIPCONST GpMetafile * metafile, GDIPCONST Point & destPoint, GDIPCONST Rect & srcRect, Unit srcUnit, EnumerateMetafileProc callback, VOID * callbackData, GDIPCONST GpImageAttributes * imageAttributes ); what is the proper way to do so?From what I can make out, the equivalent D1 declaration is probably extern (Windows) GpStatus GdipEnumerateMetafileSrcRectDestPointI( GpGraphics* graphics, GpMetafile* metafile, ref Point destPoint, ref Rect srcRect, Unit srcUnit, EnumerateMetafileProc callback, void* callbackData, GpImageAttributes* imageAttributes ); The equivalent D2 declaration would add a few consts here and there. But without seeing how WINGDIPAPI and GDIPCONST are defined, I can't be sure. Since a quick search reveals that this is a GDI+ function, I've changed the subject line to make it clearer. I presume you have the required libs? Stewart.
Nov 08 2009
nomad schrieb:I would like to use the following Win32 function in D: GpStatus WINGDIPAPI GdipEnumerateMetafileSrcRectDestPointI( GpGraphics * graphics, GDIPCONST GpMetafile * metafile, GDIPCONST Point & destPoint, GDIPCONST Rect & srcRect, Unit srcUnit, EnumerateMetafileProc callback, VOID * callbackData, GDIPCONST GpImageAttributes * imageAttributes ); what is the proper way to do so?FYI, there is GDI+ in DWT, see dwt-win\dwt\internal\gdip\
Nov 08 2009
Frank Benoit Wrote:nomad schrieb:I had no idea it already existed but since I've already got all structures, constants, enums, and some 600+ functions already include in my implementation, I'll see if I can complete it before I peek into DWT. Thank you much.I would like to use the following Win32 function in D: GpStatus WINGDIPAPI GdipEnumerateMetafileSrcRectDestPointI( GpGraphics * graphics, GDIPCONST GpMetafile * metafile, GDIPCONST Point & destPoint, GDIPCONST Rect & srcRect, Unit srcUnit, EnumerateMetafileProc callback, VOID * callbackData, GDIPCONST GpImageAttributes * imageAttributes ); what is the proper way to do so?FYI, there is GDI+ in DWT, see dwt-win\dwt\internal\gdip\
Nov 08 2009