Not exactly sure if this is off topic, so I apologize in advance if that's the case.
Anyway. I'm writing a simple map editor for my game. Because I want to eventually flesh it out to be a game editor for my game, I've decided to wrap all the functionality of the editor behind a few classes derived from the same parent (eg. CEditorFeature).
My problem is when creating window in a class. I don't want to have their WinProcs outside of the class, that goes against the purpose of my using classes in the first place.
When I try to compile (using VC6sp3), I get an error that says:
code:error C2440: 'type cast' : cannot convert from '' to 'long (__stdcall *)(struct HWND__*, unsigned int, unsigned int, long)'
My code looks like this:
code:class CMapEdit : public CEditorFeature{..BOOL CreateMEWindow ();LRESULT CALLBACK MEWndProc (HWND, UINT, WPARAM, LPARAM);}BOOL CMapEdit::CreateMEWindow (){WNDCLASSEX wcex;...wcex.lpfnWndProc = (WNDPROC) MEWndProc;...}
I can't figure out why that doesn't work. Also what's up with ''?
I tried removing the WNDPROC typecast, but that gave me a slightly different error:
code:error C2440: 'type cast' : cannot convert from 'long (__stdcall CMapEdit::*)(struct HWND__*, unsigned int, unsigned int, long)' to 'long (__stdcall *)(struct HWND__*, unsigned int, unsigned int, long)'
If anybody knows anything about this, I would greatly appreciate the help. Oh, one more thing. I'm not using MFC (nor do I plan to).
I apoligize for the long message, but I banging my head against the wall here. Ouch.
Thanks again,
OberonZ
[This message has been edited by OberonZ (edited October 01, 1999).]