Bonjour a tous,
Je veux creer un activex control base sur ATL et en gros j'instantie une boite de dialogue dans le controle. comme suit :
et ca passe toujours par le return 1;
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 CCAxTestDialog *m_dlg; CAxTestControl(): { m_bWindowOnly = TRUE; m_dlg = new CCAxTestDialog(this); } LRESULT CAxTestControl::OnCreate(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/) { HWND hwnd = m_dlg->Create(this->m_hWnd);/*, CWindow::rcDefault, WS_OVERLAPPEDWINDOW|WS_VISIBLE);*/ if(hwnd == NULL) { return 1; } m_dlg->ShowWindow(SW_SHOWNORMAL); //Show it, return 0; }
en regardant dans plus en profondeur dans le code, ca foire dans un ;
avec hInstance non NULL lpTemplateName ayant comme valeur l'ID du dialog.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8 AtlAxWinInit(); Helper::ReturnType nRet = Helper::GetInvalidValue(); HRSRC hDlg = AtlFindResource(hInstance, lpTemplateName, (StringType)RT_DIALOG); if (hDlg != NULL) {
quelqu'un aurait une piste ???
Partager