interfacing with the windows api

lee lee_member at pathlink.com
Tue Feb 21 02:55:49 PST 2006


In article <dteqjk$1biu$1 at digitaldaemon.com>, lee says...
>
>In article <dtep0n$19sj$1 at digitaldaemon.com>, Kyle Furlong says...
>>
>>lee wrote:
>>> I'm trying to write a short windows application, and I need to define a windows
>>> class object. In C this is simple since the class is defined in the windows
>>> header file. Unfortunately, I can't create a wc object in my D program. I tried
>>> importing the header file, but the class definition doesn't carry over into the
>>> program's namespace. Moreover, this is just part of a larger problem. I have
>>> been experiencing problems importing user defined data types from C header files
>>> in general. If someone could explain how D interfaces with C code, I would
>>> really appreciate it. 
>>> Thanks
>>> Lee 
>>> 
>>> 
>>RTFM, http://www.digitalmars.com/d/windows.html
>
>thanks for the reference. 
>
>Unfortunately when I tried to compile it the debugger flaged several errors in
>the resulting obj file. Each of these errors involved undefined Symbols. For
>example The first error reads;
>'winsamp.obj(winsamp) 
>error 42: Symbol Undefined _SelectObject at 8'
>
>I moved a copy of winsamp.d into the same directory as dmd.exe, and I tried
>compiling it with the line ;
>'dmd winsamp.d'
>
>Is there anything wrong with the source code. Or did I compile it wrong?
>
>
>Ok, I made a mistake compiling the files. To get it to compile correctly I needed to have typed;
' dmd winsamp.d gdi32.lib winsamp.def ' 

thanks for the help :) 





More information about the Digitalmars-d mailing list