Sign in to follow this  

Instancing a dll's class without implicit linking

This topic is 2545 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

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

This topic is 2545 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this