Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Classes Implemeted in a Dynamic Link Library

Status
Not open for further replies.

GameDude

Programmer
Jun 22, 2004
23
0
0
US
Say I have a class. It is a very large class and belongs to a group of other classes that implement themselves/inherit from themselves, etc...

These classes can be declared a giant header file without much trouble or confusion if documented in an organized way. Now, the usual way of implemeting these classes would either be in a 'cpp' file if they are to be placed directly in the application, or would be placed in an 'lib' file if they are to be referenced in a static manner in other applications.

However, while this method may be good for normal applications/packages, there are some instances where it would be nice to load this functionality dynamically. For example, if the program were to contain a scripting language that supports native functionality. The interpreter would need a way of connecting with the functions of the scipted class dynamically. This cannot be done using 'lib' files. Dynamic loading capacity would need to be implemented through the use of Dynamic Link Libraries.

My problem is, I am going to have scripted classes "inheriting" from natively declared classes. To do this, I am going to have natively declared classes contain scripted support to help make the transition...

ok, I know all this is a little over the top, but the point I am getting to is, in this particular application/engine/interface, the classes would best be organized by declaring them in header files, and implementing the functions for them in dymanic link libraries. This will make scripting MUCH easier to implement, and packaging much more organized, as I can simply have the name of all the libraries needed to run the application in an ini file. Much more dynamic. Much easier to expand. Much easier to write. (Once the scipting language is up and running, that is.)

--------------------------------------------------------------------------------------------------------------
The problem: I don't know how to implement a CLASS FUNCTION in a DYNAMIC LINK LIBRARY.
--------------------------------------------------------------------------------------------------------------

I know it can be done, as I have used applications that have used the technique I have described above. (As a matter of fact, it's these programs I am modeling my program structure off of) I just can't find any documentation on how to do this. If anyone here has any idea how to do this, or any other suggestions on how this problem might be better solved, or even a better place on these forums to post this questions, let me know.

Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top