Link to home
Start Free TrialLog in
Avatar of Dream-
Dream-

asked on

Export a function FROM exe TO dll

I have a host EXE application that loads a DLL. I would like to have the DLL use some functions from the EXE host.

Could you show me an example with code of how to do this?
ASKER CERTIFIED SOLUTION
Avatar of Lukasz Zielinski
Lukasz Zielinski
Flag of Poland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Dream-
Dream-

ASKER

Oh so I just need to export the function from the exe and use a dll function to send the exe handle.

Nice!

I will try it today.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Dream - yup that's what you need use export keyword, what ZhaawZ suggested is called "callback" and also is commonly used

ziolko.
Avatar of Dream-

ASKER

Ok, callback is another option. I will try it as well.

I think at this point the export is probably more suited to what I am trying to do. But I'll have to do some tests and see what requires less changes in my host app.
any progress?

ziolko.
Avatar of Dream-

ASKER

Yes I have tested both methods with success.

I think I am going to end up using both methods for different aspects of my program.

Is it possible to accept both the export and the callback solutions? If not I will have to give ziolko the points because his solution came in first, even though ZhaawZ is also a great solution.
>> Is it possible to accept both the export and the callback solutions?

As far as I remember, there used to be a possibility to "split points" when accepting answer. Not sure how it's now though, some things have changed here...