Click here to Skip to main content
15,885,546 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: want to make circular progress bar on the dialog?? Give some tips! Pin
Richard MacCutchan7-Jul-13 20:42
mveRichard MacCutchan7-Jul-13 20:42 
AnswerRe: want to make circular progress bar on the dialog?? Give some tips! Pin
Soumyajit Satpathy10-Jul-13 4:57
Soumyajit Satpathy10-Jul-13 4:57 
QuestionTab control with custom draw? Pin
JoneLe866-Jul-13 7:35
JoneLe866-Jul-13 7:35 
Questionhow to set entire console window background color with given RGB(SetConsoleScreenBufferInfoEx)? Pin
Falconapollo6-Jul-13 2:33
Falconapollo6-Jul-13 2:33 
AnswerRe: how to set entire console window background color with given RGB(SetConsoleScreenBufferInfoEx)? Pin
Richard MacCutchan6-Jul-13 4:46
mveRichard MacCutchan6-Jul-13 4:46 
GeneralRe: how to set entire console window background color with given RGB(SetConsoleScreenBufferInfoEx)? Pin
Falconapollo6-Jul-13 6:35
Falconapollo6-Jul-13 6:35 
GeneralRe: how to set entire console window background color with given RGB(SetConsoleScreenBufferInfoEx)? Pin
Richard MacCutchan6-Jul-13 7:12
mveRichard MacCutchan6-Jul-13 7:12 
QuestionModeless Dialog with Message Loop Pin
Manish K. Agarwal4-Jul-13 21:32
Manish K. Agarwal4-Jul-13 21:32 
I am creating a modeless dialog from an ActiveX which loads in the Internet Explorer 9/Windows 7 using following code:

Where CMyActiveXCtrl class is of COleControl type.

C++
void CMyActiveXCtrl::OnBnClickedTest()
{
   m_MainDialog.bClosed = false;
   m_MainDialog.ShowWindow( SW_SHOW );
   
   MSG Msg;

   BOOL bRet;

   while (bRet = GetMessage(&Msg, NULL, 0, 0))
   {
         if (bRet == -1)
         {
            MessageBoxA(this->m_hWnd, "Message loop error", "My ActiveX", MB_OK);
            break;
         }

         if (PreTranslateMessage( &Msg ) == 0 )
         {
              if (!::IsDialogMessage(m_MainDialog.m_hWnd, &Msg)) 
              { 
                  TranslateMessage( &Msg );
                  DispatchMessage(&Msg);
              }
         }

         if (m_MainDialog.bClosed == true)
         {
             break;
         }
   }// while
}



m_MainDialog.bClosed set true on modeless dialog close/destroy. Now when my modeless dialog is opened in ActiveX and the user closes the browser window using IE > File > Exit or clicks on top right "X" button, IE main windows closes (no longer visible) but it leaves an orphan IE process in the task manager.

The same code working fine on Windows XP/ IE 8. Can anyone suggest me what could be the problem with above message loop in OnBnClickedTest() else without that message loop, it works fine.
Manish Agarwal
manish.k.agarwal @ gmail DOT com


modified 5-Jul-13 8:03am.

AnswerRe: Modeless Dialog with Message Loop Pin
pasztorpisti5-Jul-13 14:50
pasztorpisti5-Jul-13 14:50 
GeneralRe: Modeless Dialog with Message Loop Pin
Manish K. Agarwal5-Jul-13 18:42
Manish K. Agarwal5-Jul-13 18:42 
GeneralRe: Modeless Dialog with Message Loop Pin
pasztorpisti6-Jul-13 1:55
pasztorpisti6-Jul-13 1:55 
GeneralRe: Modeless Dialog with Message Loop Pin
pasztorpisti6-Jul-13 2:08
pasztorpisti6-Jul-13 2:08 
GeneralRe: Modeless Dialog with Message Loop Pin
Manish K. Agarwal7-Jul-13 21:17
Manish K. Agarwal7-Jul-13 21:17 
GeneralRe: Modeless Dialog with Message Loop Pin
pasztorpisti7-Jul-13 22:11
pasztorpisti7-Jul-13 22:11 
GeneralRe: Modeless Dialog with Message Loop Pin
Manish K. Agarwal7-Jul-13 22:53
Manish K. Agarwal7-Jul-13 22:53 
GeneralRe: Modeless Dialog with Message Loop Pin
pasztorpisti8-Jul-13 2:24
pasztorpisti8-Jul-13 2:24 
AnswerRe: Modeless Dialog with Message Loop Pin
Erudite_Eric7-Jul-13 23:26
Erudite_Eric7-Jul-13 23:26 
GeneralRe: Modeless Dialog with Message Loop Pin
pasztorpisti8-Jul-13 8:40
pasztorpisti8-Jul-13 8:40 
GeneralRe: Modeless Dialog with Message Loop Pin
Erudite_Eric9-Jul-13 0:20
Erudite_Eric9-Jul-13 0:20 
GeneralRe: Modeless Dialog with Message Loop Pin
Erudite_Eric10-Jul-13 2:14
Erudite_Eric10-Jul-13 2:14 
GeneralRe: Modeless Dialog with Message Loop Pin
pasztorpisti10-Jul-13 2:25
pasztorpisti10-Jul-13 2:25 
GeneralRe: Modeless Dialog with Message Loop Pin
Erudite_Eric10-Jul-13 4:25
Erudite_Eric10-Jul-13 4:25 
GeneralRe: Modeless Dialog with Message Loop Pin
pasztorpisti10-Jul-13 5:17
pasztorpisti10-Jul-13 5:17 
GeneralRe: Modeless Dialog with Message Loop Pin
Erudite_Eric10-Jul-13 23:18
Erudite_Eric10-Jul-13 23:18 
GeneralRe: Modeless Dialog with Message Loop Pin
pasztorpisti11-Jul-13 0:21
pasztorpisti11-Jul-13 0:21 

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.