   DLLs in C++
  This is probably a very easy thing to do. People in the gamedev forums are allways very kind and helpful, so I try asking here.How do I use and make DLLs in C++?Thanks, Niklas   
  If you have MSVC++, you can use __declspec(dllexport) and __declspec(dllimport) keywords... or you can use a .def file.   ;  -Again in MSVC, start a project to make a dll, hopefully most of the things will be in there for you, they also put a couple of sample functions in there. If you look for something called implicit linking, then that makes it slightly easier, (to use), - so you put your functions headers in the .h file (in the same way as the example will show), than you put the function bodys in the cpp file.After you have done that you'll find in your project folder or the debug folder a dll file, and a lib file. Click and copy them, move them to the folder of the project where you want to use the dll. I don't know what subdirectory they need to go in though - hopefully someone can say? You'll also need to copy over your dll projects .h file as well, the .h file just goes in the same subdirectory as you normal .h & cpp files. Add the lib file to your project settings, (where you normally add lib files), also then #include the .h file in your project.Now you should be able to just declare & use the things from your dll as normal.Don't forget when ever you change your dll code you'll have to recopy the files over again. One other thing, when you first go to run a dll it will ask for a program to run it on, you can just browse to one of your projects exe's for that.Does anyone else know how you go about adding other classes to a dll project?   ;  Yeah, you just use them as normal in the DLL and you're set.The trick is how you use them outside of the DLL and how the DLL itself is used/compiled.  As far as I know, you can't export classes from a DLL that's loaded at runtime (LoadLibrary(..)) unless you want to do fancy things like find the full symbol name (after name-mangling) and whatnot.  The best you can do then is to provide an c-like interface and use the DLL that way.However, you are more than welcome to use classes in statically linked libraries in other exe's and DLL's.  This is because the symbols and linkage and whatnot is resolved at compile time.To use the latter, just use the macro that VS creates for you in front of classes and stuff as you would normally (I believe VS gives you a few example exports).   ;  Its possible to use dynamicly linked libraries with classes, but you have to be clever ;)If you have in your main program (or better a "core" dll, which is staticly linked) an abstract base class (who is exported), and in your dynamicly linked dll a c function (delcared in a extern "C" block) which returns an object derived from the abstract class.  Simply use LoadLibrary and GetProcAddress, and voila!   ;Washu's journal has quite a few posts on DLLs. Search for DLL in that page, it's quite far down.   ;  Hi, I think I'm ok for the naming part, I'm using mine statically, what I meant was can you add extra .h & cpp files to a dll project for separate classes etc? I'm hoping to get my gui code interface into a dll, but that means quite a few separate classes.thanks, - posted at the same time there.   ;  yeah this should be accepted!   