Jump to content
  • Advertisement
Sign in to follow this  
  • entries
  • comments
  • views

function pointer struct through a DLL

Sign in to follow this  


yeah, I need to learn how to do that :P

Heard that's how they do it in the Quake engines. And I understand why. I've just written my second proxy class for accessing functions in a DLL. Redudant work. Should be able to do some template magic by using Loki. But somehow I decided not to use any external libraries for ThumbView.

That's pretty dumb. I should learn to use libraries like Boost and Loki. Especially Boost::Lambda.

Well I might be rewriting ShellExtension using the new ATL later. And then I might start switching working code with learning code using 3rd party libraries.

No wait, that's even dumber.
Sign in to follow this  


Recommended Comments

I did that in one of my engine experiments once, turned out pretty successful.

typedef bool (*pfnEngineFunction)(int pTest);

struct sEngineExports
pfnEngineFunction superFunc;

bool MySuperFunction( int pTest ) { /// OMG!!! return true; }

// In game init
sEngineExports export;
export.superFunc = &MySuperFunc;

// Do dll loading here

// Pass struct to interface
dll->InitEnginePlugin( &export );

///////// In dll
void InitEnginePlugin( sEngineExports *engine )
// Call engine MySuperFunction via function pointer

Or something like that anyhow...

Share this comment

Link to comment
thanx evolutional =D

I'm gonna check that out someday, since my hardcoded stuff seems to work. And muer's C++ library has a DLLProxy template thingie that looks kinda interesting.

To another time!

Share this comment

Link to comment

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
  • Advertisement

Important Information

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

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!