Jump to content
  • Advertisement
Sign in to follow this  
d1sc0rd

syntax question: WinMaker (): _hwnd (0)

This topic is 5172 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

This is coming from http://www.relisoft.com/Win32/winnie.html Here it is in context if you dont' want to go to the link. class WinMaker { public: WinMaker (): _hwnd (0) {} WinMaker (char const * caption, char const * className, HINSTANCE hInstance); void Show (int cmdShow) { ::ShowWindow (_hwnd, cmdShow); ::UpdateWindow (_hwnd); } protected: HWND _hwnd; }; WinMaker::WinMaker (char const * caption, char const * className, HINSTANCE hInstance) { _hwnd = ::CreateWindow ( className, // name of a registered window class caption, // window caption WS_OVERLAPPEDWINDOW, // window style CW_USEDEFAULT, // x position CW_USEDEFAULT, // y position CW_USEDEFAULT, // witdh CW_USEDEFAULT, // height 0, // handle to parent window 0, // handle to menu hInstance, // application instance 0); // window creation data } This is a tutorial on the win32 api. Also, if anyone has any win32 api tutorial links, I would love to check out a new source. Thanks in advance.

Share this post


Link to post
Share on other sites
Advertisement
Er... Sorry... What is the question ?

If your question is "what do this line mean" then : it initialize the member _hwnd with 0. You can have more initializers like this (it is really like calling the constructor of a base class).


class WinMaker : public Object
{
bool _fullscreen;
HWND _hwnd;
public:
WinMaker(bool fs);
}
WinMaker::WinMaker(bool fs) : _fullscreen(fs), _hwnd(0), Object()
{
}


HTH

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!