Jump to content
  • Advertisement

Archived

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

doctorsixstring

wrapping Win32, OOP-style

This topic is 6037 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
Advertisement
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
Thanks guys, I think I got it working pretty good. I have a WinMain and a WindowProc outside of any object, but everything else is handled by another class.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!