Hi, I am having a slight problem in one thing. The fact is that I create a Windows with API functions and I draw some objects like Ellipses and so on,.... with the WM_PAINT Event, and with the WM_CREATE Event I want to create a class (called MiButtton) inherited from CButton. The constructor of MiButton has an argument that is the Handle of the main window, so MiButton(HWND hWnd). The constructor has the following code:
cwnd = new CWnd();
cwnd->Attach( hWnd );
CButton::Create(L"Hola Sosio", WS_VISIBLE|WS_CHILD, CRect(10, 50, 80, 80), cwnd, 1);
The problem appear when I run the program and begin with an error.When I click the [X] button, the applications go on perfectly without any error and the button appear as I specify.
Can anyone expline me about this? Am I doing anything wrong?
Thanks in advance.
cwnd = new CWnd();
cwnd->Attach( hWnd );
CButton::Create(L"Hola Sosio", WS_VISIBLE|WS_CHILD, CRect(10, 50, 80, 80), cwnd, 1);
The problem appear when I run the program and begin with an error.When I click the [X] button, the applications go on perfectly without any error and the button appear as I specify.
Can anyone expline me about this? Am I doing anything wrong?
Thanks in advance.