www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - HELP

reply lee <lee_member pathlink.com> writes:
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.
Jan 16 2006
next sibling parent Vladimir Kulev <Vladimir_member pathlink.com> writes:
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.
Jan 16 2006
prev sibling parent Mike Parker <aldacron71 yahoo.com> writes:
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.
Jan 17 2006