Making a .dll

This is a discussion on Making a .dll within the C++ Programming forums, part of the General Programming Boards category; Hi i hav Borland compiler and was wondering if any one would tell me how to make a .dll? I ...

Making a .dll

Hi i hav Borland compiler and was wondering if any one would tell me how to make a .dll? I want to begin modding and have been making console .exes for awhile but for this i need to make a .dll.
Thx for any help.

It varies from compiler to compiler - exactly which one are you using? And is it for Windows or DOS? Also - I think modding may be considered cracking, and they are quite strict with rules against that here.

I'm not sure about the specifics of your compiler, but I can tell you the aproximate steps. Create a new DLL project, code your functions, and compile. Place this DLL in the working directory of your other project. At some point in that project, call LoadLibrary() and then GetProcAddress() to access specific functions. You'll have to learn a little bit about function pointers to do that, but it's not hard. Alternatively, you could import the functions into your project, which could be easier depending on your program. Here is a little example of the first option:

>>I think modding may be considered cracking
>Your definition of modding must be way off then.
Yub yub. Think Counter-Strike

But what you said about just declaring/defining the files normally except in a DLL project, isn't there something about having to use extern 'C' before the function name if you want it to be usable, or something to that effect?

If I did your homework for you, then you might pass your class without learning how to write a program like this. Then you might graduate and get your degree without learning how to write a program like this. You might become a professional programmer without knowing how to write a program like this. Someday you might work on a project with me without knowing how to write a program like this. Then I would have to do you serious bodily harm. - Jack Klein