Sign in to follow this  

Calling executable functions from DLL

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

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