Sign in to follow this  
cmoney

Calling executable functions from DLL

Recommended Posts

cmoney    122
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
Kippesoep    892
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
cmoney    122
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
Nivelo    122
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

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