PDA

View Full Version : message handler macro for OnVisible method



mesman00
August 6th, 2004, 16:07
does anyone know what macro i need to add to the message map in order to use the OnVisible() method in the CHtmlView class. what i want to do is allow the user be able to show or not show the web browser (chtml view object). this is how i am currently doing it. i call the OnVisible method and pass a boolean value (i overloaded OnVisible() in the CHtmlView class). Then the OnVisible method calls the SetVisible method of the chtmlview object and passes the boolean value passed to the OnVisible method. Am i doing this correctly? shouldn't there be a macro in the message map since the method OnVisible is an event? if anyone can clear up how to properly do this i would greatly appreciate it.

mesman00
August 9th, 2004, 14:46
bumpity bump bump

smcd
August 9th, 2004, 15:38
I don't use MFC (mainly for reasons such as this problem, and the others you have with it) or I'd answer you to keep the bumpity down :P

mesman00
August 12th, 2004, 16:07
here's the solution to anyone who might be interested in the future. took me alot of reading in msdn to figure this out.

CWnd *pBrowser;
pBrowser = GetDlgItem(IDC_WEB_BROWSER);
pBrowser->ShowWindow(TRUE);

i think this can probably be used for most MFC crontrols (static controls, buttons, etc). The GetDlgItem() method recieves the resource id of the control whose view you want to toggle, and the ShowWindow() method recieves either TRUE or FALSE, TRUE if you want to show the control, FALSE if you want to hide the control.

smcd
August 12th, 2004, 22:20
Ah, I don't think I initially understood exactly what you wanted to do. Glad to see you got it working & shared for anyone who might use it in the future. :)