Guest_imported
New member
- Jan 1, 1970
- 0
Im having trouble with compiling this piece of code. Ive cut out the irrelevant stuff
class DWND
{
public:
//constructor
DWND(<parameters>)
{
WNDCLASSEX wcx;
wcx.lpfnWndProc = this->MainWndProc; //problem line
}
LRESULT CALLBACK MainWndProc(<parameters>)
{
blah blah
}
}
The problem is that the compiler complains that it cant convert from:
long (__stdcall DWND::*)(<parameters>)
to
long (__stdcall *)(<parameters>)
It compiles properly if the MainWndProc function isnt a member of a class but when it is, the compiler tries to include the DWND:: in front of it and complains that it doesnt match the definition of the lpfnWndProc member of the WNDCLASSEX structure.
I dont know how to make the compiler ignore the DWND:: before it. Anyone know how I can do this? or isnt it possible?
Also, how should the subject title of this message have been written? I spent about 10 minutes trying to figure what order to put all those words and I still dont know.
class DWND
{
public:
//constructor
DWND(<parameters>)
{
WNDCLASSEX wcx;
wcx.lpfnWndProc = this->MainWndProc; //problem line
}
LRESULT CALLBACK MainWndProc(<parameters>)
{
blah blah
}
}
The problem is that the compiler complains that it cant convert from:
long (__stdcall DWND::*)(<parameters>)
to
long (__stdcall *)(<parameters>)
It compiles properly if the MainWndProc function isnt a member of a class but when it is, the compiler tries to include the DWND:: in front of it and complains that it doesnt match the definition of the lpfnWndProc member of the WNDCLASSEX structure.
I dont know how to make the compiler ignore the DWND:: before it. Anyone know how I can do this? or isnt it possible?
Also, how should the subject title of this message have been written? I spent about 10 minutes trying to figure what order to put all those words and I still dont know.