Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > Problem:made Modal MessageBOx @ some event become modaless

Reply
Thread Tools

Problem:made Modal MessageBOx @ some event become modaless

 
 
saxenavaibhav17@gmail.com
Guest
Posts: n/a
 
      04-26-2007
Hi Friends.

I got many help from this forum.

Thanks a lot guys.



Well friends I have problem.

In application,

Dialog is there, I put button on that it popsup another dialog say
cutting parameter dialog .

On dialog there is spin button which decrease the corresponding edit
box value when this value cross the validation i put value should be 0
t o10000 .

if user click on spin button to make it below 0.

at that messageBox pops up. but this situation become Modaless.

and all other dialog case



following is the snippet of code.

when I put break point at c i find in call stack it comes at
position

(a->b->c->d) sequence



a)IMPLEMENT_MWLINVELSPIN_NOTIFY_WITH_CB(MWToolCutP aramsDlg,IDC_EDIT_CUT_PARAM_Z_FEEDRATE,
0, MAX_LINVEL_VAL, OnKillFocus)


b) #define IMPLEMENT_MWLINVELSPIN_NOTIFY_WITH_CB( classname,
editid,min,max,callback ) \
IMPLEMENT_MWSPIN_NOTIFY_INTERNAL(m_LinVelUnit,clas sname,editid,min,max,-1.00)
\
callback##(); \
}



c) Outcome:utcome( int retVal, SeverityIndex sevIndex, UINT
uTitleStrID,DWORD dwHelpID, CWnd* pParentWnd/* = NULL*/)
{
m_retVal = retVal;
m_SevIndex = sevIndex;

m_uTitleStrID = uTitleStrID;

// test if it is a valid string id
if( m_uTitleStrID )
{
//MWResourceLoader resLoad;
CString strTitle;
BOOL bValid = strTitle.LoadString(m_uTitleStrID);
ASSERT(bValid);
}

// Set the Help ID
m_dwHelpID = dwHelpID;
m_bChangeMessageBoxButtonLabels = FALSE;
m_pParentWnd = pParentWnd;
}





d)UINT Outcome:isplay(int nID, ...)
{
#ifdef AFR_PARASOLID
return IDYES;
#endif

CString str;
CString sout;
TCHAR* ptr;
va_list va;
long retVal = -101;

//MWResourceLoader resLoad;
str.LoadString(nID); // load string from String table

va_start(va,nID); // initialize va_list

ptr = sout.GetBuffer(str.GetLength()+500);
_vstprintf(ptr,str,va); // stuff ptr(sout) with data
sout.ReleaseBuffer();

CWinApp* pSWApp = AfxGetApp();
CWnd* pSWWnd = NULL;
if (NULL == m_pParentWnd)
pSWWnd = (NULL != pSWApp) ? pSWApp->m_pMainWnd : NULL;
else
pSWWnd = m_pParentWnd;

HWND hSWWnd = (NULL != pSWWnd) ? pSWWnd->GetSafeHwnd() : NULL;






HWND hWndParent = hSWWnd;

CString title;
if( m_uTitleStrID )
title.LoadString(m_uTitleStrID);

UINT uMBType = 0;

switch( m_SevIndex )
{
case MW_ERROR :
if( !m_uTitleStrID )
title.LoadString(IDS_COMM_COMM_MW_ERROR_TITLE);
uMBType = MB_OK | MB_APPLMODAL | MB_ICONERROR | MB_SETFOREGROUND;
break;
case MW_WARNING :
if( !m_uTitleStrID )
title.LoadString(IDS_COMM_COMM_MW_WARNING_TITLE);
uMBType = MB_YESNO | MB_APPLMODAL | MB_ICONWARNING |
MB_SETFOREGROUND;
break;
case MW_OPTIONSWARNING:
if( !m_uTitleStrID )
title.LoadString(IDS_COMM_COMM_MW_WARNING_TITLE);
uMBType = MB_YESNOCANCEL | MB_APPLMODAL | MB_ICONWARNING |
MB_SETFOREGROUND;
break;
case MW_MESSAGE :
if( !m_uTitleStrID )
title.LoadString(IDS_COMM_COMM_MW_MESSAGE_TITLE);
uMBType = MB_OK | MB_APPLMODAL | MB_ICONINFORMATION |
MB_SETFOREGROUND;
break;
default:
ASSERT(0);
break;
}



Thanks in advance guys

 
Reply With Quote
 
 
 
 
Jim Langston
Guest
Posts: n/a
 
      04-27-2007
<(E-Mail Removed)> wrote in message
news:(E-Mail Removed) oups.com...
> Hi Friends.
>
> I got many help from this forum.
>
> Thanks a lot guys.
>
>
>
> Well friends I have problem.
>
> In application,
>
> Dialog is there, I put button on that it popsup another dialog say
> cutting parameter dialog .
>
> On dialog there is spin button which decrease the corresponding edit
> box value when this value cross the validation i put value should be 0
> t o10000 .
>
> if user click on spin button to make it below 0.
>
> at that messageBox pops up. but this situation become Modaless.
>
> and all other dialog case
>
>
>
> following is the snippet of code.
>
> when I put break point at c i find in call stack it comes at
> position
>
> (a->b->c->d) sequence
>
>
>
> a)IMPLEMENT_MWLINVELSPIN_NOTIFY_WITH_CB(MWToolCutP aramsDlg,IDC_EDIT_CUT_PARAM_Z_FEEDRATE,
> 0, MAX_LINVEL_VAL, OnKillFocus)
>
>
> b) #define IMPLEMENT_MWLINVELSPIN_NOTIFY_WITH_CB( classname,
> editid,min,max,callback ) \
> IMPLEMENT_MWSPIN_NOTIFY_INTERNAL(m_LinVelUnit,clas sname,editid,min,max,-1.00)
> \
> callback##(); \
> }
>
>
>
> c) Outcome:utcome( int retVal, SeverityIndex sevIndex, UINT
> uTitleStrID,DWORD dwHelpID, CWnd* pParentWnd/* = NULL*/)
> {
> m_retVal = retVal;
> m_SevIndex = sevIndex;
>
> m_uTitleStrID = uTitleStrID;
>
> // test if it is a valid string id
> if( m_uTitleStrID )
> {
> //MWResourceLoader resLoad;
> CString strTitle;
> BOOL bValid = strTitle.LoadString(m_uTitleStrID);
> ASSERT(bValid);
> }
>
> // Set the Help ID
> m_dwHelpID = dwHelpID;
> m_bChangeMessageBoxButtonLabels = FALSE;
> m_pParentWnd = pParentWnd;
> }
>
>
>
>
>
> d)UINT Outcome:isplay(int nID, ...)
> {
> #ifdef AFR_PARASOLID
> return IDYES;
> #endif
>
> CString str;
> CString sout;
> TCHAR* ptr;
> va_list va;
> long retVal = -101;
>
> //MWResourceLoader resLoad;
> str.LoadString(nID); // load string from String table
>
> va_start(va,nID); // initialize va_list
>
> ptr = sout.GetBuffer(str.GetLength()+500);
> _vstprintf(ptr,str,va); // stuff ptr(sout) with data
> sout.ReleaseBuffer();
>
> CWinApp* pSWApp = AfxGetApp();
> CWnd* pSWWnd = NULL;
> if (NULL == m_pParentWnd)
> pSWWnd = (NULL != pSWApp) ? pSWApp->m_pMainWnd : NULL;
> else
> pSWWnd = m_pParentWnd;
>
> HWND hSWWnd = (NULL != pSWWnd) ? pSWWnd->GetSafeHwnd() : NULL;
>
>
>
>
>
>
> HWND hWndParent = hSWWnd;
>
> CString title;
> if( m_uTitleStrID )
> title.LoadString(m_uTitleStrID);
>
> UINT uMBType = 0;
>
> switch( m_SevIndex )
> {
> case MW_ERROR :
> if( !m_uTitleStrID )
> title.LoadString(IDS_COMM_COMM_MW_ERROR_TITLE);
> uMBType = MB_OK | MB_APPLMODAL | MB_ICONERROR | MB_SETFOREGROUND;
> break;
> case MW_WARNING :
> if( !m_uTitleStrID )
> title.LoadString(IDS_COMM_COMM_MW_WARNING_TITLE);
> uMBType = MB_YESNO | MB_APPLMODAL | MB_ICONWARNING |
> MB_SETFOREGROUND;
> break;
> case MW_OPTIONSWARNING:
> if( !m_uTitleStrID )
> title.LoadString(IDS_COMM_COMM_MW_WARNING_TITLE);
> uMBType = MB_YESNOCANCEL | MB_APPLMODAL | MB_ICONWARNING |
> MB_SETFOREGROUND;
> break;
> case MW_MESSAGE :
> if( !m_uTitleStrID )
> title.LoadString(IDS_COMM_COMM_MW_MESSAGE_TITLE);
> uMBType = MB_OK | MB_APPLMODAL | MB_ICONINFORMATION |
> MB_SETFOREGROUND;
> break;
> default:
> ASSERT(0);
> break;
> }


This looks like Microsoft specific code, so is off topic here. Try one of
the Microsoft newsgroups.


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Become The master in computer hardware to become successfull shilla Computer Security 1 01-22-2011 06:19 PM
Opening modal page from modal page Don ASP .Net 0 05-27-2008 11:49 PM
Modal and non modal in same app Leila Java 0 04-26-2005 09:48 PM
post the form data in modal window and close the modal window. Matt HTML 1 06-01-2004 08:22 PM



Advertisments