Jump to content
  • Advertisement
Sign in to follow this  
Bow_vernon

Instancing a dll's class without implicit linking

This topic is 2739 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

For functions, it's easy(just use GetProcAddress), you dont even need the header files of the dll...but what about class and structs??or variables?

Share this post


Link to post
Share on other sites
Advertisement
I could be wrong but i think a DLL just exports function names (both member and non member functions).

Because of that, you'd need a helper function inside of the DLL to do what you need.

of course youd also have to have some way to know what the struct or class looked like in memory (members etc!)

There may be a better way though, what are you trying to accomplish?

Share this post


Link to post
Share on other sites
Im making a quake-like engine system, where the game code resides in a dll, and the engine only load it and call appropriate interface funtions. I want the engine to be able to override some game variable. obviously this is hidden from the engine. should I write get/set variable method in game code?

Share this post


Link to post
Share on other sites
Hrm... yeah I think the get and set is the way to go.

What kind of variable is it?

One thing you might consider is making a console and console variable system (like how you can press ~ and bring down the console and set variables).

If the engine and game level can both get and set console variable values, they can effectively communicate and over-ride values for each other.

You would have to ask the console system for a variable by name which means string lookups or hash lookups, but if it was a variable you used often you could cache off a handle or a pointer to it for quicker read/write.

Also this kind of console variable system is really nice during development to be able to debug things easier - and more fun after launch when you can do things like turn on low gravity without a recompile!

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!