Maybe someone could give me some advises or substances about creating Dynamic Link Libraries and fit it to games because I even dont't know where to start?
Is there a non-MSDN answer? I was looking for answers to this today as well. I have code I wrote and compiled with Codeblocks IDE and would like to get this done with it, at least until I get Visual Studio installed sometime soon. Thanks for any help you can give.
MSDN is just fine - there's not much of a difference between compiling with MinGW (Code::Blocks' compiler, pretty much) and Visual Studio. Probably the only gotcha is that MinGW calls the '-A' variants rather than the '-W' variants by default (e.g. CreateFile becomes CreateFileA instead of CreateFileW), though you shouldn't be using those functions anyway.
I mostly only do command line compiling work, as IDEs get in my way - especially when dealing with dlls, where, in my opinion, their behavior is atrocious. They make all these directories and subdirectories, with the host in one directory and the dll in another, then they can't find each other and whatnot. Like I said, a real mess. And they all do it. So I don't know if this will help you. However, it works with TDM-GCC-4.8. I do have a recent version of CodeBlocks I use occasionally though, and I believe I've gleaned the command line compiling strings from those generated within the CodeBlocks development environment. So here's a little useless test app to show the mechanics of getting it all working together. Here's the dll, which simply has a useless function - IncrOne(int iNum), to incremrnt whatever number is passed into it as a parameter. And all the files go in the same directory...
The command line compilation strings are commented out at top in both files. Note I needed two invocations of the compiler to create the dllMain.dll file. If somebody knows how to do it simpler with this example I'd appreciate knowing about it. The MS compiler is much simpler to use in my opinion. I can't believe its really as complicated as my command line from CodeBlocks has it. Its only redeeming feature though is that it does work, so I guess that counts for something. Below is my full command line screen for building the dll, then the host, then invoking the host.exe and calling InCrOne() in the dll with 5. Note my project is at C:\Code\CodeBlks\dllTrial...