Download Reference Manual
The Developer's Library for D
About Wiki Forums Source Search Contact

Win32 bindings

Moderators: kris

Posted: 01/26/08 12:43:22

While working on DWT-Windows, i encountered problems with the tango.sys.win32 package. I have no expirience with win32 developemnt so i might miss something essential :)

1.) There is this Ansi vs. Unicode thing in windows. Many structs are dependending on the decisions on which platform an application runs. So I think this is a compile time decision. Structs exist with the naming schema xxxA and xxxW. At compile time, depending on version statements an alias should be created.

Shall i try to change that, so that there is version(ANSI) statement like this:

version( ANSI ){

2.) I encounter not declared functions (AddFontResourceExW, AddFontResourceExA).
Shall I try to add them to tango?

3.) DWT uses also gdiplus.lib, shall i try to add that binding to tango? module name?


Author Message

Posted: 01/26/08 13:39:49

hm, the gdiplus seems to be C++, so here i have a problem.

Posted: 01/27/08 22:18:12

gdi+ is indeed C++, but the dll exports are all C functions. It appears that Microsoft wraps the C functions with C++ (in the gdi+ headers) and publishes the C++ interface only (plus a very select number of C functions).

There is no support for using the C interface directly. What this means is that it's possible to use the C functions if one figures out to do so, or it's possible to do some sort of a OOP D wrap (in light of the C++ version) of these C functions to achieve a similar goal.

In dwt, I guess we'll need to wrap them somehow and figure out how to access the C++ members. Whatever we come up with may be useful for tango adoption.

Posted: 01/31/08 10:21:57

Have you looked at how the old DWT handles this

Posted: 01/31/08 23:18:12

SWT 3.0.2 did not use GDI+.

But i think a solution is on the way.

Posted: 02/12/08 20:41:21

It seems, like it is not clear how to proceed with the windows bindings in tango, so I solved the dwt related problems with not using the tango bindings directly. Instead i added them as redundant copy into dwt. Now i can maintain them as needed, without the need to wait for decisions/responses of the tango win32-bindings responsibles.

If someone is interested in removing this redundancy and/or fixing the tango bindings, please contact me.