Re: calling modal dialog function from external c code




tim wrote:
Are you using this in a Regular DLL or a different thread?

Regular DLL, at a guess.

That will do it. You will need to use AFX_MANAGE_STATE and change the
state.

This would mean m_cltStaticText has not been subclassed.

Having a quick search around, I suspect this maybe where I am going
wrong...


How did you associate the static control that is represented by m_ctlStaticText?

Using the Add Member Variable Wizard, which appears to add the
following:

// MyAppDlg class header
CStatic m_ctlStaticText;

// MyAppDlg::DoDataExchange
CDialog::DoDataExchange(pDX);
DDX_Control(pDX, ID_STATIC_TEXT, m_ctlStaticText);

Am I missing something there?

That all looks good. I think not using AFX_MANAGE_STATE is very likely
to be the problem. This is needed only in a Regular DLL and not in EXE
or a MFC Extension DLL.


---
Ajay

.



Relevant Pages

  • Re: Warning: m_pMainWnd is NULL in CWinApp::Run - quitting application
    ... It appears you have a Regular DLL (as wizard is putting this macro) (A ... COM component can be create in a Regular or MFC Extension DLL and that ... This is just guess work as I dont know the details of your ...
    (microsoft.public.vc.mfc)
  • Re: URGENT : ADO and COM dll
    ... "Alexander Nickolov" wrote: ... >> I made a regular dll to encapsulate data access. ... >> then I test this dll with a simple Exe, and all my queries work. ...
    (microsoft.public.win32.programmer.ole)
  • Re: Tooltips not shown in dlls modeless dialog
    ... It's a MFC Extension DLL in my project. ... it's a kown issue in the Regular DLL. ... I want to have tooltips at the buttons in the dialog. ... MSG msg; ...
    (microsoft.public.vc.mfc)
  • Re: Display dialog from dll
    ... I am assuming this is a Regular DLL and not a MFC Extension DLL. ... any particular reason to make this choice? ...
    (microsoft.public.vc.mfc)
  • Re: Tooltips working in MFC app, but not from DLL
    ... It is a regular DLL, not an MFC extension DLL. ... parameter of the AFX_MANAGE_STATE call from AfxGetStaticModuleState ... (recommended by the wizard source code comments) ...
    (microsoft.public.vc.mfc)