Original Post
I am writing a Win32 wrapper class. For the creation of the window I am writing a static member function of the class. Like this:
However, the compiler isn''t agreeing with this approach. I am at college, not having the ability to access a normal compiler(MSVC++ 6) so I am stuck with Borland C++ 5.02. This is the error code:
-Earth is 98% full. Please delete anybody you can.
class CWindow
{
public:
CWindow();
~CWindow();
static LRESULT StaticWndProc(HWND hWnd, UINT Message, WPARAM wParam, LPARAM lParam);
virtual LRESULT WndProc(UINT Message, WPARAM wParam, LPARAM lParam);
virtual bool Create(HINSTANCE hInstanceApp, HICON hIcon, HCURSOR hCursor, const char *szClassname,
const char *szCaption, int iX, int iY, int iWidth, int iHeight);
HWND GetHwnd();
private:
HINSTANCE m_hInstance;
HWND m_hWnd;
};
Error: cwindow.cpp(69,29):Cannot convert ''long (*)(HWND__ *,unsigned int,unsigned int,long)'' to ''long (__stdcall *)(HWND__ *,unsigned int,unsigned int,long)''The errorcode occurs on the WndClass.lpfnWndProc = StaticWndProc; Any ideas? This is simple, but I do not understand. So, if you can explain why this is including the correct answer, I would be happy. Toolmaker
-Earth is 98% full. Please delete anybody you can.