Jump to content
  • Advertisement
Sign in to follow this  
cmoney

Calling executable functions from DLL

This topic is 4898 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 have a DLL that needs to call some functions located in the main executable. Is there a slick way I can do this without passing the DLL function pointers? (I'm using VC++, BTW.)

Share this post


Link to post
Share on other sites
Advertisement
Or make the EXE export them and use GetProcAddress in the DLL. Amounts to the same thing as function pointers, though it is slightly more expandable.

Share this post


Link to post
Share on other sites
Thanks for the advise. This is error handling stuff, so moving it to the DLL is not really an option. Exporting them from the executable sounds kinda messy to me, so I guess I'll init it with function pointers.

Share this post


Link to post
Share on other sites
If you are calling on methods for error handling, logging etc. then why not put these into their own dll, or a utilities dll. These are then easily accessible and you can return an error status back to the exe in order to take appropriate action in the main application?

Niv

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!