digitalmars.D - interfacing with the windows api
- lee (10/10) Feb 21 2006 I'm trying to write a short windows application, and I need to define a ...
- John C (4/20) Feb 21 2006 Interfacing with C, and interfacing with C source code are two different...
- lee (2/24) Feb 21 2006 Lee
- lee (2/24) Feb 21 2006 Lee
- John C (4/38) Feb 21 2006 Ok. The sentence "importing user defined data types from C header files"...
- Kyle Furlong (2/14) Feb 21 2006 RTFM, http://www.digitalmars.com/d/windows.html
- lee (11/25) Feb 21 2006 thanks for the reference.
- Chris Miller (2/14) Feb 21 2006 Try: dmd winsamp.d gdi32.lib
- lee (3/30) Feb 21 2006 ' dmd winsamp.d gdi32.lib winsamp.def '
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
Feb 21 2006
"lee" <lee_member pathlink.com> wrote in message news:dteims$1198$1 digitaldaemon.com...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 LeeInterfacing with C, and interfacing with C source code are two different things. This might help you: http://www.digitalmars.com/d/interfaceToC.html
Feb 21 2006
In article <dtencf$188h$1 digitaldaemon.com>, John C says..."lee" <lee_member pathlink.com> wrote in message news:dteims$1198$1 digitaldaemon.com...LeeI'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 LeeInterfacing with C, and interfacing with C source code are two different things. This might help you: http://www.digitalmars.com/d/interfaceToC.html My problem isn't that I can't access functions defined in C header files, It's that I can't use user defined data types defined within those files. Even after I imported the header file, I still wasn't able to use classes that were defined within it.
Feb 21 2006
In article <dtencf$188h$1 digitaldaemon.com>, John C says..."lee" <lee_member pathlink.com> wrote in message news:dteims$1198$1 digitaldaemon.com...LeeI'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 LeeInterfacing with C, and interfacing with C source code are two different things. This might help you: http://www.digitalmars.com/d/interfaceToC.html I'm trying to access data types defined within c header files. I can access functions that are defined externally, But I haven't been able to gain access to class and variable declarations.
Feb 21 2006
"lee" <lee_member pathlink.com> wrote in message news:dtepfr$1afh$1 digitaldaemon.com...In article <dtencf$188h$1 digitaldaemon.com>, John C says...Ok. The sentence "importing user defined data types from C header files" led me to that conclusion."lee" <lee_member pathlink.com> wrote in message news:dteims$1198$1 digitaldaemon.com...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 LeeInterfacing with C, and interfacing with C source code are two different things. This might help you: http://www.digitalmars.com/d/interfaceToC.html I'm trying to access data types defined within c header files. I can access functions that are defined externally, But I haven't been able to gain access to class and variable declarations.Lee
Feb 21 2006
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 LeeRTFM, http://www.digitalmars.com/d/windows.html
Feb 21 2006
In article <dtep0n$19sj$1 digitaldaemon.com>, Kyle Furlong says...lee wrote: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 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?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 LeeRTFM, http://www.digitalmars.com/d/windows.html
Feb 21 2006
On Tue, 21 Feb 2006 05:38:44 -0500, lee <lee_member pathlink.com> wrote: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 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?Try: dmd winsamp.d gdi32.lib
Feb 21 2006
In article <dteqjk$1biu$1 digitaldaemon.com>, lee says...In article <dtep0n$19sj$1 digitaldaemon.com>, Kyle Furlong says...' dmd winsamp.d gdi32.lib winsamp.def ' thanks for the help :)lee wrote: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 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;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 LeeRTFM, http://www.digitalmars.com/d/windows.html
Feb 21 2006