Archived

This topic is now archived and is closed to further replies.

wrapping Win32, OOP-style

This topic is 5670 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Is it possible to create a class that processes an entire Win32 program? I want to be able to have a class something like this: class CMain { public: CMain(); ~CMain(); int WINAPI WinMain(HINSTANCE hinstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd); LRESULT CALLBACK WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam); } Is something like this possible, or am I forced to have the main API functions outside of my class?

Share this post


Link to post
Share on other sites
I think you''ll have to have the WinMain procedure outside of the class as the Windows Kernel calls that directly and won''t look for it inside a class. But other than that, I believe anything else can essentially be inside the class.

Share this post


Link to post
Share on other sites