View Full Version: DLLs

C++ Learning Community > C++ Help > DLLs


Title: DLLs
Description: How to write DLLs


Dragon - June 21, 2003 12:49 AM (GMT)
Do I need to add some special code or something in order to make DLLs, or do normal functions such as int func() work?

ih8censorship - June 21, 2003 02:09 AM (GMT)
well from remembering when i was trying to make dlls in ASM (before my head started to hurt from trying to learn asm) i think you need to make like your own function with a bunch of code and then call that from another program. but if your making windows dlls you need to know about the windows api which i dont because im not that far yet. but im sure they have books about the windows api.

Shadow of the Moon - June 21, 2003 02:36 AM (GMT)
Xception from the GM forum has some great, well-commented examples on his site.

Xception - June 21, 2003 07:50 PM (GMT)
You have to export your functions to be able to import them:
I use this macro:
CODE
#define export extern "C" __declspec( dllexport )


it exports as "C" function(without mangled name) and with cdecl calling convention, use it this way:
CODE
export double myfunc() { return 0;}


Dragon - June 23, 2003 02:08 AM (GMT)
Now I know how to do it now. I self-taught myself, whoohoo! (with some help from Xception). :)




* Hosted for free by InvisionFree