Home » Extra libraries, Code snippets, applications etc. » C++ language problems and code snippets » DLL and U++ type
DLL and U++ type [message #2182] |
Mon, 03 April 2006 14:45 |
mauro.bottizzo
Messages: 2 Registered: April 2006
|
Junior Member |
|
|
hi,
I am writing an DLL, using:
extern "C" { ... }
When i defining the "C" functions it's possible use U++ type, like "String", "Value", etc ...?? If no, only the poiners, like: String&, Value&, etc??
Thanks.
|
|
|
Re: DLL and U++ type [message #2192 is a reply to message #2182] |
Mon, 03 April 2006 18:58 |
|
mirek
Messages: 14105 Registered: November 2005
|
Ultimate Member |
|
|
mauro.bottizzo wrote on Mon, 03 April 2006 08:45 | hi,
I am writing an DLL, using:
extern "C" { ... }
When i defining the "C" functions it's possible use U++ type, like "String", "Value", etc ...?? If no, only the poiners, like: String&, Value&, etc??
Thanks.
|
I am not 100% sure, but I think yes, it is possible.... (extern "C" in practice just removes name mangling from your functions, means overloading will be impossible, but nothing more).
Mirek
|
|
|
|
|
|
|
Re: DLL and U++ type [message #2428 is a reply to message #2182] |
Wed, 12 April 2006 14:01 |
mr_ped
Messages: 825 Registered: November 2005 Location: Czech Republic - Praha
|
Experienced Contributor |
|
|
stdlib.h *is* higher magic for me.
I never really learned C or C++, I dislike to learn too many implementation-dependent details. When I work with some new programming language, I simply read language reference guide to learn syntax and basic commands, take some framework which inits the application, and start from there...
That allowed me to stay "virgin" clean from Win32 API, STL and many more commonly used libraries. Only one which I really did study thoroughly was DirectX, otherwise I tend to pick up as small subset as is needed to finish my work, or just do the main algorithm and let someone else to finish those API things.
Than again, I find clean assembly source more readable than some high-level templatized C++ source, so I'm sort of programmer dinosaur.
(void *) is "language reference" thing and works for me.
stdlib.h is some foreign source I never bothered to study and learn.
WARNING: I'm not suggesting anyone should follow my path, you can end up coding things which are ready to use in some nice library. You should have at least idea what those foreign libraries are capable of - to make sure you don't reinvent the wheel all the time.
But maybe a lesson can be learned here, it's not always that important to know every API from head... OTOH language reference is IMHO always important. Platforms and libraries do change often, language stays the same (ok, evolves a bit too, but surely not as fast as libraries). If somebody is learning Win32 API and doesn't understand C++ (language part) very good, he has very likely wrong priorities, and will suffer a lot later during development.
|
|
|
|
|
Goto Forum:
Current Time: Fri Nov 01 01:31:17 CET 2024
Total time taken to generate the page: 0.01755 seconds
|