Hello, my problem:
Need a dialog box to get 2 coordinates (x,y) to draw a rectangle in the main window!! I have managed to do it but only when I resize the window!
Probably a stupid question but... Thankx
Printable View
Hello, my problem:
Need a dialog box to get 2 coordinates (x,y) to draw a rectangle in the main window!! I have managed to do it but only when I resize the window!
Probably a stupid question but... Thankx
Hi,
After closing the dialog try to invalidate the main window. Look at CWnd::InvalidateRect or SDKCode:BOOL InvalidateRect(
HWND hWnd, // handle to window
CONST RECT* lpRect, // rectangle coordinates
BOOL bErase // erase state
);
Thank you for answering but...
I have a OnOk function member of MyDialog class that calls Invalidate().
The ideia is when you press the OK button the figure is placed in the main window!
I´m still searching for a solution ( i´m a begginer in this matter)
Thankx again!!
If you have a pointer to the main wnd in your dialog then call invalidate in OnOK (pMainWnd->InvalidateRect(...)). Otherwise call invalidate for the main wnd after DoModal is finished.
Hey!!! It works!!
Thank YOU VERY MUCH!!