Mail Archives: djgpp/1998/02/25/20:00:54
Chris Bilson wrote:
>
> I think the question here should be do we need to use DLLs in DOS. I think
> that the main reason DLLs were designed was that in Windows (or any other
> multitasking OS, really) you might have many different apps using the same
> functions and code. Instead of static linking everything, and having
> multiple copies of the same code in memory at any one time, we can put this
> stuff in DLLs and share it.
well there are cases (like mine :) where using a DLL would be useful.
Let's say I want to program a CRPG (actually a warcraft clone :)
Now I have the main engine, which gives me the sound, network, input,
graphics, pathfinding etc etc. It would be very useful if I could add a
new character without relinking the whole thing (like if I only
distribute the EXE and the user can add his own guys).
I could have something like a subdirectory with the charater's name and
in that subdirectory, have all the graphics, sounds etc and this little
file called behaviour.dll in which I would have all the functions for
that character. the character is attacked by someone, call a function in
the DLL. the time is 12 and the character set a timer for this hour,
send a message (call a function) to the DLL etc etc.
see what I mean? (of course I could use scripting, which is what I'm
looking at now, but a DLL is compiled code, therefore a lot faster...)
--
--> http://www.cam.org/~tudor <--
- Raw text -