Click here to Skip to main content
15,887,027 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: modeless dialog and GetParent() Pin
23_44414-Sep-05 4:42
23_44414-Sep-05 4:42 
GeneralRe: modeless dialog and GetParent() Pin
David Crow14-Sep-05 8:30
David Crow14-Sep-05 8:30 
GeneralRe: modeless dialog and GetParent() Pin
23_44415-Sep-05 3:26
23_44415-Sep-05 3:26 
Questionbitmaps Pin
_tasleem14-Sep-05 3:19
_tasleem14-Sep-05 3:19 
AnswerRe: bitmaps Pin
M.Mehrdad.M14-Sep-05 3:28
M.Mehrdad.M14-Sep-05 3:28 
AnswerRe: bitmaps Pin
M.Mehrdad.M14-Sep-05 3:29
M.Mehrdad.M14-Sep-05 3:29 
AnswerRe: bitmaps Pin
David Crow14-Sep-05 3:39
David Crow14-Sep-05 3:39 
QuestionError in ShowWindow() function ? Pin
Amarelia14-Sep-05 3:12
Amarelia14-Sep-05 3:12 
Hi
I have developed a dialogue based MFC application. On that dialogue I have used two ActiveX control called WebBrowserCtrl, Their IDs are as : IDC_EXPLOREER1 AND IDC_EXPLORER2.

I have declared it in my CWebBrowserDlg.h file as

CWebBrowser2 m_WebBrowserCtrl;
CWebBrowser2 m_WebBrowserCtrl2;
bool m_bWebBrowserCtrl;

Now what I want to do is when initially I load form It should show some site on it. Then after few seconds it should show another ActiveX control having different site loaded into it.

For this I have used OnTimer() function and have one boolean variable which i set to true and flase alternatively....

It works fine for the first time.....I mean first it shows content into IDC_EXPLORE1 then it shows Content into IDC_EXPLORER2 and after that it shows illegal error (Abort, Retry, Ignore) and on debuging it by pressing Retry button it takes me to following code in WINOCC.cpp file

Here it shows m_hWnd as NULL.

BOOL CWnd::ShowWindow(int nCmdShow)
{
ASSERT(::IsWindow(m_hWnd));

if (m_pCtrlSite == NULL)
return ::ShowWindow(m_hWnd, nCmdShow);
else
return m_pCtrlSite->ShowWindow(nCmdShow);
}
My code is as following.....

So for that I have written code like this :

//In WebBrowserDlg.cpp
BOOL CWebBrowserDlg::OnInitDialog()
{
CDialog::OnInitDialog();
// Add "About..." menu item to system menu.

// IDM_ABOUTBOX must be in the system command range.
ASSERT((IDM_ABOUTBOX & 0xFFF0) == IDM_ABOUTBOX);
ASSERT(IDM_ABOUTBOX < 0xF000);

CMenu* pSysMenu = GetSystemMenu(FALSE);
if (pSysMenu != NULL)
{
CString strAboutMenu;
strAboutMenu.LoadString(IDS_ABOUTBOX);
if (!strAboutMenu.IsEmpty())
{
pSysMenu->AppendMenu(MF_SEPARATOR);
pSysMenu->AppendMenu(MF_STRING, IDM_ABOUTBOX, strAboutMenu);
}
}
// Set the icon for this dialog. The framework does this automatically
// when the application's main window is not a dialog
SetIcon(m_hIcon, TRUE); // Set big icon
SetIcon(m_hIcon, FALSE); // Set small icon

//Set the timer so that after every 15 seconds it will call OnTimer function
m_nTimer = SetTimer(1, 15000, 0);
m_bWebBrowserCtrl = true;

// navigate to main web page, my favorite web page
m_WebBrowserCtrl.Navigate(m_Site, NULL, NULL, NULL, NULL);
m_WebBrowserCtrl2.Navigate("http://www.google.co.in/", NULL, NULL, NULL, NULL);

return TRUE; // return TRUE unless you set the focus to a control
}

void CWebBrowserDlg::OnTimer(UINT nIDEvent)
{
if (m_bWebBrowserCtrl == true)
{
m_WebBrowserCtrl.ShowWindow(SW_HIDE);
m_WebBrowserCtrl2.ShowWindow(SW_SHOW);
m_bWebBrowserCtrl = false; //I have forgotten to write this two
//sentence....where as actually it is in my code
}
else
{
m_WebBrowserCtrl.ShowWindow(SW_SHOW);
m_WebBrowserCtrl2.ShowWindow(SW_HIDE);
m_bWebBrowserCtrl = true;//I have forgotten to write this two
//sentence....where as actually it is in my code

}
}
Any help please....? Any other idea to show two control alternatively...

Regards

Amarelia Maehsh
Gujarat
India


-- modified at 9:36 Wednesday 14th September, 2005
AnswerRe: Error in ShowWindow() function ? Pin
krmed14-Sep-05 3:24
krmed14-Sep-05 3:24 
GeneralRe: Error in ShowWindow() function ? Pin
Amarelia14-Sep-05 3:44
Amarelia14-Sep-05 3:44 
AnswerRe: Error in ShowWindow() function ? Pin
kakan14-Sep-05 4:12
professionalkakan14-Sep-05 4:12 
QuestionHow to disable a menu item Pin
snprani14-Sep-05 2:50
snprani14-Sep-05 2:50 
AnswerRe: How to disable a menu item Pin
-Dy14-Sep-05 9:45
-Dy14-Sep-05 9:45 
QuestionHow to disable a menu item Pin
snprani14-Sep-05 2:46
snprani14-Sep-05 2:46 
AnswerRe: How to disable a menu item Pin
kakan14-Sep-05 2:56
professionalkakan14-Sep-05 2:56 
QuestionWMI,Help,help,help,Help,help,help,Help,help,help Pin
Tcpip200514-Sep-05 2:31
Tcpip200514-Sep-05 2:31 
AnswerRe: WMI,Help,help,help,Help,help,help,Help,help,help Pin
Tcpip200514-Sep-05 2:37
Tcpip200514-Sep-05 2:37 
GeneralRe: WMI,gni gni gni gni gni Pin
toxcct14-Sep-05 3:00
toxcct14-Sep-05 3:00 
GeneralRe: WMI,gni gni gni gni gni Pin
David Crow14-Sep-05 3:12
David Crow14-Sep-05 3:12 
GeneralRe: WMI,gni gni gni gni gni Pin
toxcct14-Sep-05 3:17
toxcct14-Sep-05 3:17 
GeneralRe: WMI,gni gni gni gni gni Pin
Tcpip200514-Sep-05 3:27
Tcpip200514-Sep-05 3:27 
GeneralRe: WMI,gni gni gni gni gni Pin
toxcct14-Sep-05 3:33
toxcct14-Sep-05 3:33 
GeneralRe: WMI,gni gni gni gni gni Pin
Tcpip200514-Sep-05 3:57
Tcpip200514-Sep-05 3:57 
GeneralRe: WMI,gni gni gni gni gni Pin
Tcpip200514-Sep-05 4:06
Tcpip200514-Sep-05 4:06 
GeneralRe: WMI,gni gni gni gni gni Pin
Tcpip200514-Sep-05 3:22
Tcpip200514-Sep-05 3:22 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.