
Envoyé par
poukill
Essaye ceci :
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
|
if (DialogBox( hInstance,
MAKEINTRESOURCE(IDD_DIALOG_DISPLAY_SIZE),
hWnd,
boost::bind(
&Calibration::Initialize_CallBack,
this, // this est un pointeur, boost::ref est inutile !
_1,
_2,
_3,
_4)
) != IDOK){
return false;
}
return true; |
Hésite pas à regarder la
doc de boost::bind pour comprendre comment ça fonctionne !

D'accord, j'ai compris le fonctionnent! Merci!
Comme c'est l'API C de Windows qui est appelée, j'ai ajouté des define.
1 2 3 4 5 6 7
|
#define BOOST_BIND_ENABLE_STDCALL
#define BOOST_MEM_FN_ENABLE_STDCALL
#define BOOST_BIND_ENABLE_FASTCALL
#define BOOST_MEM_FN_ENABLE_FASTCALL
#define BOOST_MEM_FN_ENABLE_CDECL
#include <boost/bind.hpp> |
Par contre, le prototype de la fonction n'est pas reconnu car j'ai une erreur lors de la compilation:
1 2 3 4 5 6
|
error C2664: 'DialogBoxParamW'*:
impossible de convertir le paramètre 4 de
'boost::_bi::bind_t<R,F,L>' en 'DLGPROC' |
J'ai vérifié les types, ils sont correct.
Par contre la fonction est de type :
INT_PTR (__stdcall Calibration::* )(HWND,UINT,WPARAM,LPARAM)
alors que DLGPROC est de type :
INT_PTR (__stdcall * )(HWND,UINT,WPARAM,LPARAM)
Comment faire?
Merci,
Yves
Partager