Sign in to follow this  

syntax question: WinMaker (): _hwnd (0)

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

This topic is 4864 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this