Using DoModal from CDialog when called from a DLL 
Author Message
 Using DoModal from CDialog when called from a DLL

Hi everyone,

I am having problems with bring up my custom dialog which uses  the CDialog
class. It fails when running it from a DLL. If I change the DLL to an EXE or
a standalone, it works with no problem.

This DLL is called dynamically from a C App. Looking through the MFC
DoModal() code, I realized that the error was coming from
"AfxGetInstanceHandle()". That function fails everytime it is call from the
DLL.

What should I do to correct this problem?

Thanks
Mel.



Tue, 02 Dec 2003 23:50:35 GMT  
 Using DoModal from CDialog when called from a DLL
Mel!

AFX_MANAGE_STATE is your friend, check the online help.

Johan Rosengren
Responsable Informatique
PACTA S.A.


Quote:
> Hi everyone,

> I am having problems with bring up my custom dialog which uses  the
CDialog
> class. It fails when running it from a DLL. If I change the DLL to an EXE
or
> a standalone, it works with no problem.

> This DLL is called dynamically from a C App. Looking through the MFC
> DoModal() code, I realized that the error was coming from
> "AfxGetInstanceHandle()". That function fails everytime it is call from
the
> DLL.

> What should I do to correct this problem?

> Thanks
> Mel.



Wed, 03 Dec 2003 13:31:25 GMT  
 Using DoModal from CDialog when called from a DLL
Johan, I tried "AFX_MANAGE_STATE " but I am having problems with linking. My
makefile already has mfcd42d.lib link to it, so I am having DLLMAIN
duplication problem. When I took the mfcd42.lib off, I had a number of
unresolved error.


Quote:
> Mel!

> AFX_MANAGE_STATE is your friend, check the online help.

> Johan Rosengren
> Responsable Informatique
> PACTA S.A.



> > Hi everyone,

> > I am having problems with bring up my custom dialog which uses  the
> CDialog
> > class. It fails when running it from a DLL. If I change the DLL to an
EXE
> or
> > a standalone, it works with no problem.

> > This DLL is called dynamically from a C App. Looking through the MFC
> > DoModal() code, I realized that the error was coming from
> > "AfxGetInstanceHandle()". That function fails everytime it is call from
> the
> > DLL.

> > What should I do to correct this problem?

> > Thanks
> > Mel.



Sat, 06 Dec 2003 22:20:17 GMT  
 Using DoModal from CDialog when called from a DLL
Sorry the DLL I am having conflit with is R10MSVC.DLL. Please make the
correction below.

Thanks
Mel.


Quote:
> Johan, I tried "AFX_MANAGE_STATE " but I am having problems with linking.
My
> makefile already has mfcd42d.lib link to it, so I am having DLLMAIN
> duplication problem. When I took the mfcd42.lib off, I had a number of
> unresolved error.



> > Mel!

> > AFX_MANAGE_STATE is your friend, check the online help.

> > Johan Rosengren
> > Responsable Informatique
> > PACTA S.A.



> > > Hi everyone,

> > > I am having problems with bring up my custom dialog which uses  the
> > CDialog
> > > class. It fails when running it from a DLL. If I change the DLL to an
> EXE
> > or
> > > a standalone, it works with no problem.

> > > This DLL is called dynamically from a C App. Looking through the MFC
> > > DoModal() code, I realized that the error was coming from
> > > "AfxGetInstanceHandle()". That function fails everytime it is call
from
> > the
> > > DLL.

> > > What should I do to correct this problem?

> > > Thanks
> > > Mel.



Sat, 06 Dec 2003 22:28:28 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Q: How to move a CDialog before calling DoModal()

2. Calling CDialog::DoModal crashes

3. HELP! CDialog/DoModal problems in regular DLL

4. CDialog::DoModal(), CDialog::EndDialog() Design Flaw

5. calling DoModal from a MFC dll

6. CDialog: Service calling a MFC-linked DLL instanciating a modeless dialog box

7. cannot create cdialog in a dll calling from vb

8. Q: CDialog::DoModal () fails

9. CDialog::DoModal

10. CDialog.DoModal problem

11. Help. CDialog::DoModal Fail in _beginthreadex

12. CDialog::DoModal() Behaviour

 

 
Powered by phpBB® Forum Software