P
prettysmurfed
Hi all
I have a bit of a problem, the subject of this post is almost selfexplaing.
But here goes: Heres an example of the code I want to implement, its
all nice and simple, but the flaw is I can't seem to get the adress of the
member function stated properly in the DialogBox function. I thought it
was enough to write it as Dialog:lgProc, if it was a normal situation
and DlgProc was a normal function (not member of anything) then you
would simply do it like this:
DialogBox(hInstance,TEXT("DLG"),hwnd,DlgProc);
What is wrong with my current approach. I've already been googling
the issue all day, and the only thing I could come up with was making
the member function static, but thats not fun, as I can't change anything
within the callback procedure.
////////////////////////////////////////////////////////////////////////////
//////////////////////////////
class Dialog
{
public :
Dialog();
void Init(HINSTANCE, HWND);
~Dialog();
private :
BOOL CALLBACK DlgProc(HWND, UINT, WPARAM, LPARAM);
};
void Dialog::Init(HINSTANCE hInstance, HWND hwnd)
{
DialogBox(hInstance,TEXT("DLG"),hwnd,Dialog:lgProc);
}
BOOL CALLBACK Dialog:lgProc(HWND h, UINT m, WPARAM w, LPARAM l)
{
...
}
////////////////////////////////////////////////////////////////////////////
//////////////////////////////
I'm currently using Dev-c++ 4.9.8.0, and the error message generated
by the compiler is
In member function `void OOWrapper::start(HINSTANCE__*,
cannot convert `BOOL (OOWrapper::*)(HWND__*, unsigned int,
I hope theres a way out this,
Go steady
Martin
I have a bit of a problem, the subject of this post is almost selfexplaing.
But here goes: Heres an example of the code I want to implement, its
all nice and simple, but the flaw is I can't seem to get the adress of the
member function stated properly in the DialogBox function. I thought it
was enough to write it as Dialog:lgProc, if it was a normal situation
and DlgProc was a normal function (not member of anything) then you
would simply do it like this:
DialogBox(hInstance,TEXT("DLG"),hwnd,DlgProc);
What is wrong with my current approach. I've already been googling
the issue all day, and the only thing I could come up with was making
the member function static, but thats not fun, as I can't change anything
within the callback procedure.
////////////////////////////////////////////////////////////////////////////
//////////////////////////////
class Dialog
{
public :
Dialog();
void Init(HINSTANCE, HWND);
~Dialog();
private :
BOOL CALLBACK DlgProc(HWND, UINT, WPARAM, LPARAM);
};
void Dialog::Init(HINSTANCE hInstance, HWND hwnd)
{
DialogBox(hInstance,TEXT("DLG"),hwnd,Dialog:lgProc);
}
BOOL CALLBACK Dialog:lgProc(HWND h, UINT m, WPARAM w, LPARAM l)
{
...
}
////////////////////////////////////////////////////////////////////////////
//////////////////////////////
I'm currently using Dev-c++ 4.9.8.0, and the error message generated
by the compiler is
In member function `void OOWrapper::start(HINSTANCE__*,
cannot convert `BOOL (OOWrapper::*)(HWND__*, unsigned int,
I hope theres a way out this,
Go steady
Martin