Hi,

I have to import an existing Mfc dialog in order to open this dialog in my qt code.

I use QWinHost, and have implement a class HostWindow as I found in the example. In the reimplementation of the createWindow function from QWinHost, I do this :

Qt Code:
  1. HWND HostWindow::createWindow(HWND parent, HINSTANCE instance)
  2. {
  3. CIHM_CAM_CTRLDlg *dlg = new CIHM_CAM_CTRLDlg();
  4. return dlg->GetSafeHwnd();
  5. }
To copy to clipboard, switch view to plain text mode 

The handle which is returned is null, and dlg is also null. It seems that my CDialog is not inialized.

Do somebody have an idea of what I need to do to make it works ?

Claudie