Thread overview
HELP
Jan 16, 2006
lee
Jan 16, 2006
Vladimir Kulev
Jan 17, 2006
Mike Parker
January 16, 2006
I'm writing a small application in D that requires several windows api calls. To access these functions I need to define variables with data types defined in c header files. So far I've only been able to do this implicitly, using methods like typeof(), or using alternative data types. When I try writing something like

sockaddr_ variable name;

I get an error message during compilation saying sockaddr_ is an undeclared identifyer.


January 16, 2006
You can convert C header files to D, so you will be able to use all structures from these headers.

In article <dqgdfe$1hke$1@digitaldaemon.com>, lee says...
>
>I'm writing a small application in D that requires several windows api calls. To access these functions I need to define variables with data types defined in c header files. So far I've only been able to do this implicitly, using methods like typeof(), or using alternative data types. When I try writing something like
>
>sockaddr_ variable name;
>
>I get an error message during compilation saying sockaddr_ is an undeclared identifyer.


January 17, 2006
lee wrote:
> I'm writing a small application in D that requires several windows api calls. To
> access these functions I need to define variables with data types defined in c
> header files. So far I've only been able to do this implicitly, using methods
> like typeof(), or using alternative data types. When I try writing something
> like 
> 
> sockaddr_ variable name;
> 
> I get an error message during compilation saying sockaddr_ is an undeclared
> identifyer.
> 
> 
Many Win32 API declarations can be found in std.c.windows.windows, std.c.windows.winsock, and std.c.windows.com. You can also use std.socket, which abstracts away the platform specific socket stuff. Any declarations you need that aren't already declared in one of those modules you can declare yourself. Use the std.c.windows.* modules as examples.