December 26, 2012
HolĂ ,

I am currently reading Programming Windows and coding his examples + my own initiatives. I know I am not the first one to do this and Andrej Mitrovic directed me to his code samples. I could not help but notice that those directives:
import win32.SOME_MODULE;
were used and are not supported anymore. I believe everything was moved to the core.sys.windows.windows header. Now somewhere along the way, either some MAJOR CHUNKS of the API got lost or they were never declared in the first time. I am curious to know how that happened and if this is planned to get fix for the next dmd release?

In any cases, I need those functions to test the Win32 api as I please so I started adding them to my own local import module. Then I started thinking: Surely, I am not the first one to do this? So I am asking the community if there is some knowledge of a more complete windows module somewhere?

If not, then I would be glad to add my contributions to the header so that it gets eventually completed. Now, in my HUMBLE opinion, for people developing Windows programs or cross compatible code (using the win32 api...) using D, isn't this kind of a big annoyance (maybe it should get prioritize)? Plus, for the newcomers making the jump from a language like C++ to D intending to program windows this might look like a major step back (since they got the full headers & stuff).

Additionally, I was wondering if it would be in the plans to also automagically link on Windows import libraries other than those currently supported (like gdi32 for example)?

Lemme know what you think.
December 26, 2012
http://www.dsource.org/projects/bindings/wiki/WindowsApi
December 26, 2012
On Wednesday, 26 December 2012 at 17:52:02 UTC, Martin wrote:
> http://www.dsource.org/projects/bindings/wiki/WindowsApi

KK cool, I will browse them. However, this is a 1 to 1 correlation between windows headers and D versions, which is cool. I was hoping more for a direct replacement of core.sys.windows.windows. Though I can still use what you showed me, thanks.
December 26, 2012
On 12/26/12, Phil Lavoie <maidenphil@hotmail.com> wrote:
> I believe everything was moved to the core.sys.windows.windows header.

No, that module existed for a long time but it was lacking a lot of functionality, so a couple of devs created the WindowsAPI project instead.
December 26, 2012
On Wednesday, 26 December 2012 at 18:35:56 UTC, Andrej Mitrovic wrote:
> On 12/26/12, Phil Lavoie <maidenphil@hotmail.com> wrote:
>> I believe everything was moved to the core.sys.windows.windows header.
>
> No, that module existed for a long time but it was lacking a lot of
> functionality, so a couple of devs created the WindowsAPI project
> instead.

Makes sense, do you know of any plans to merge those with the dmd distributables?
December 26, 2012
On 12/26/12, Phil Lavoie <maidenphil@hotmail.com> wrote:
> Makes sense, do you know of any plans to merge those with the dmd distributables?

It was discussed many times. I don't know if the Phobos team is willing to merge the dsource.org WinAPI in its current layout. WinAPI has aliases to Ascii/Unicode versions of functions which they don't like (or maybe it's just Walter who doesn't like it), and it has a directory and file structure. Putting this whole API into a single file would be insane (it would be a 70.000 lines file). And the other problem is that currently DMD is distributed with all header and binary files for all OSes, so adding WinAPI would increase the size of the .zip file. We should have separate packages for each OS, but Walter is in charge of making them so I don't know when things will improve.

Personally I'm tired of discussing this as the discussions always reach a stale-mate.
December 26, 2012
You know what, I have browsed it a little bit and I think the choice to make aliases to A and W versions was the right one. I was thinking of adding a
version( Unicode ) {
  aliases here...
}
Of my own but I can see this is exactly what has been done so I am thrilled. One last question: do you know if people are planning to maintain this for windows 8 and following?

I'll download this and let you know if I am having any unsurmountable difficulty.

Cheers!

Phil
December 26, 2012
All right I got a problem now.
Including winver.d triggers the inclusion of version.lib through this:
pragma(lib, "version.lib");
However, this import library does not exist. So I created it using,implib /noi /system version.lib ...\System32\version.dll then moved it to the dmd\windows\lib folder.
Now when running using rdmd I get this error message:
--- errorlevel 1
Which means... WHAT?!?!?!?!

Thanks for any help
December 26, 2012
On Wednesday, 26 December 2012 at 21:56:31 UTC, Phil Lavoie wrote:
> All right I got a problem now.
> Including winver.d triggers the inclusion of version.lib through this:
> pragma(lib, "version.lib");
> However, this import library does not exist. So I created it using,implib /noi /system version.lib ...\System32\version.dll then moved it to the dmd\windows\lib folder.
> Now when running using rdmd I get this error message:
> --- errorlevel 1
> Which means... WHAT?!?!?!?!
>
> Thanks for any help


If you have the Windows SDK:

cd C:\D\dmd2\windows\lib\
coffimplib "C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Lib\version.lib"  version.lib
December 26, 2012
On Wednesday, 26 December 2012 at 21:56:31 UTC, Phil Lavoie wrote:
> All right I got a problem now.
> Including winver.d triggers the inclusion of version.lib through this:
> pragma(lib, "version.lib");
> However, this import library does not exist. So I created it using,implib /noi /system version.lib ...\System32\version.dll then moved it to the dmd\windows\lib folder.
> Now when running using rdmd I get this error message:
> --- errorlevel 1
> Which means... WHAT?!?!?!?!
>
> Thanks for any help

KK I think it's related to that bug: http://d.puremagic.com/issues/show_bug.cgi?id=8377. So apparently it has something to do with the align directive being used. Fortunately it has been fixed. I'll have to rebuild dmd or wait for new release.
« First   ‹ Prev
1 2 3 4
Top | Discussion index | About this forum | D home