473,399 Members | 3,401 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

Problem:made Modal MessageBOx @ some event become modaless

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 ;-)

Apr 26 '07 #1
1 2938
<sa*************@gmail.comwrote in message
news:11**********************@u32g2000prd.googlegr 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.
Apr 27 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Deryck | last post by:
Hello, I have been modifying some javascript shopping basket code and have run into a problem. I have produced a subset of the HTML/JS that shows the problem and placed it here: ...
1
by: Rohit Raghuwanshi | last post by:
Hello all, we are running a delphi application with DB2 V8.01 which is causing deadlocks when rows are being inserted into a table. Attaching the Event Monitor Log (DEADLOCKS WITH DETAILS) here....
0
by: Josema | last post by:
Hi to all... I have a class that create a group of textboxes and a button For other side i have a webform, and in this webform i instanciate the class... I would like to know how to use the...
8
by: Sarah | last post by:
I need to access some data on a server. I can access it directly using UNC (i.e. \\ComputerName\ShareName\Path\FileName) or using a mapped network drive resource (S:\Path\FileName). Here is my...
6
by: Samuel R. Neff | last post by:
I'm having weird results with a form that is already displayed modally (via ShowDialog) displaying a second form via ShowDialog. The last form is not modal even though it's called with ShowDialog....
6
by: utkarsh | last post by:
Hi All, I am using the following method "FireAsync" (i got the following information from the google groups) to fire the event for all the subscribers. Is there another way to fire the event...
1
by: andreas | last post by:
Hi, I start with a class project and after compiling I add a form to the project and change the project properties to run a windows application This project don't recognize the method messagebox...
7
by: Andrew Ducker | last post by:
I'm writing some unit tests, to make sure that my windows forms code works properly after refactoring, and I've bumped into a problem - Messagebox.show. There are a couple of places where my...
0
by: =?Utf-8?B?QW5kcmV3?= | last post by:
When we switch between the tabs, the background image of the tab seems to be reloaded everytime, and the tabs become flickering, the problem become more serious when more tabs are dragged on the...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.