Link to home
Start Free TrialLog in
Avatar of gshivag
gshivag

asked on

Invoking Dailogs from DLLs(Not Using MFC)

Hi,

I have a DLL(on Win32 Platform) where I have to invoke a Dialog(resource is part of this DLL project). This DLL will be used and loaded(interchangebly) by multiple EXEs. I am using "DialogBox()" for invoking this dialog. I am getting this error "The specified resource name can not be found in the image file." Before I create this dialog I pass "hInstance" to this call.
Now my question is..
Can anybody guide me where I am committing the mistake ? What are the steps to take to fix this ? I would appreciate if I get the code itself.

Thanx in anticipation.
Shivkumar
Avatar of nietod
nietod

Where is the resouce for the dialog? Is it in the DLL or in the EXE that uses the DLL?   What module handle are you passing to DialogBox()?  It must be the handle to the module EXE/DLL that has the dialog resource.  If you pass the handle to the other module, it will not work.
ASKER CERTIFIED SOLUTION
Avatar of wylliker
wylliker

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
I sort of thought that was my answer.....
Nietod,

I just went out and embellished where you were going with a code snippet as a comment.

If gshivag had offered up, I would have suggested the points to you.  Second Q today that I have been involved with that the asker has popped points to the wrong expert (other one actually went to someone who's answer had been rejected and was completely wrong!).

The askers need to get it right when accepting answers or accepting comments as answers, but in fairness it seems that most do.
I didn't realize that was a comment.  Unfortuantly when a comment is accepted as an answer, there is no indication it was a comment.  That can make an expoert look sort of "greedy" when they are not, like in this case.   That will be changed, hopefully soon.  Sorry.