Hello.
I am having problems accessing methods from a class inside a static function.
I basically have two classes. One called CWindow that creates a window(obviously ), which uses a callback function (also inside CWindow).
The other class is called CSkin which will be use the created window and draw things on it.

This is the thing. I want CSkin to call one of it's own methods (in this case PaintSkin(HDC hdc)) when the message WM_PAINT is sent to the window. But, I can't access anything from my CSkin class inside the callback function.
I can easily access them from other functions, but not in the callback function. Which I guess have something to do with it being static, it is however necessary or otherwise I receive a compile error.

My Window class:
Code:
class CWindow
{
public:
	CWindow();
	~CWindow();
        
        int CreateWindow( );
        ...
private:
        ...
	CSkin *skin;
	static LRESULT CALLBACK WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam);
};
Constructor-code, where I create an instance of my CSkin class:
Code:
CWindow::CWindow()
{
        ...
	CWindow::skin = new CSkin;
        ...
}
CreateWindow()-code, WndProc needs to be static:
Code:
int CWindow::CreateWindow()
{
        ...
	wc.lpfnWndProc   = (WNDPROC)(WndProc);
        ...
}
Callback-code, this is where I want the instance of CSkin to call it's PaintSkin()-method. But "CWindow::skin->" doesn't give me anything at all, and I can't access it.
Code:
LRESULT CALLBACK CWindow::WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
    switch(msg)
    {
		case WM_PAINT:
                        ...
			if(CWindow::skin != NULL)
				// CWindow::skin->PaintSkin(ps.hdc); // Desired result 
                        ...
    }
}

How shall I proceed?
(I am using VS.NET 2k5 and the Win32 API).

Thanks.