473,796 Members | 2,742 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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_MWL INVELSPIN_NOTIF Y_WITH_CB(MWToo lCutParamsDlg,I DC_EDIT_CUT_PAR AM_Z_FEEDRATE,
0, MAX_LINVEL_VAL, OnKillFocus)
b) #define IMPLEMENT_MWLIN VELSPIN_NOTIFY_ WITH_CB( classname,
editid,min,max, callback ) \
IMPLEMENT_MWSPI N_NOTIFY_INTERN AL(m_LinVelUnit ,classname,edit id,min,max,-1.00)
\
callback##(); \
}

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

m_uTitleStrID = uTitleStrID;

// test if it is a valid string id
if( m_uTitleStrID )
{
//MWResourceLoade r resLoad;
CString strTitle;
BOOL bValid = strTitle.LoadSt ring(m_uTitleSt rID);
ASSERT(bValid);
}

// Set the Help ID
m_dwHelpID = dwHelpID;
m_bChangeMessag eBoxButtonLabel s = 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;

//MWResourceLoade r 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.ReleaseBuf fer();

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.LoadStrin g(m_uTitleStrID );

UINT uMBType = 0;

switch( m_SevIndex )
{
case MW_ERROR :
if( !m_uTitleStrID )
title.LoadStrin g(IDS_COMM_COMM _MW_ERROR_TITLE );
uMBType = MB_OK | MB_APPLMODAL | MB_ICONERROR | MB_SETFOREGROUN D;
break;
case MW_WARNING :
if( !m_uTitleStrID )
title.LoadStrin g(IDS_COMM_COMM _MW_WARNING_TIT LE);
uMBType = MB_YESNO | MB_APPLMODAL | MB_ICONWARNING |
MB_SETFOREGROUN D;
break;
case MW_OPTIONSWARNI NG:
if( !m_uTitleStrID )
title.LoadStrin g(IDS_COMM_COMM _MW_WARNING_TIT LE);
uMBType = MB_YESNOCANCEL | MB_APPLMODAL | MB_ICONWARNING |
MB_SETFOREGROUN D;
break;
case MW_MESSAGE :
if( !m_uTitleStrID )
title.LoadStrin g(IDS_COMM_COMM _MW_MESSAGE_TIT LE);
uMBType = MB_OK | MB_APPLMODAL | MB_ICONINFORMAT ION |
MB_SETFOREGROUN D;
break;
default:
ASSERT(0);
break;
}

Thanks in advance guys ;-)

Apr 26 '07 #1
1 2955
<sa************ *@gmail.comwrot e in message
news:11******** **************@ u32g2000prd.goo glegroups.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_MWL INVELSPIN_NOTIF Y_WITH_CB(MWToo lCutParamsDlg,I DC_EDIT_CUT_PAR AM_Z_FEEDRATE,
0, MAX_LINVEL_VAL, OnKillFocus)
b) #define IMPLEMENT_MWLIN VELSPIN_NOTIFY_ WITH_CB( classname,
editid,min,max, callback ) \
IMPLEMENT_MWSPI N_NOTIFY_INTERN AL(m_LinVelUnit ,classname,edit id,min,max,-1.00)
\
callback##(); \
}

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

m_uTitleStrID = uTitleStrID;

// test if it is a valid string id
if( m_uTitleStrID )
{
//MWResourceLoade r resLoad;
CString strTitle;
BOOL bValid = strTitle.LoadSt ring(m_uTitleSt rID);
ASSERT(bValid);
}

// Set the Help ID
m_dwHelpID = dwHelpID;
m_bChangeMessag eBoxButtonLabel s = 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;

//MWResourceLoade r 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.ReleaseBuf fer();

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.LoadStrin g(m_uTitleStrID );

UINT uMBType = 0;

switch( m_SevIndex )
{
case MW_ERROR :
if( !m_uTitleStrID )
title.LoadStrin g(IDS_COMM_COMM _MW_ERROR_TITLE );
uMBType = MB_OK | MB_APPLMODAL | MB_ICONERROR | MB_SETFOREGROUN D;
break;
case MW_WARNING :
if( !m_uTitleStrID )
title.LoadStrin g(IDS_COMM_COMM _MW_WARNING_TIT LE);
uMBType = MB_YESNO | MB_APPLMODAL | MB_ICONWARNING |
MB_SETFOREGROUN D;
break;
case MW_OPTIONSWARNI NG:
if( !m_uTitleStrID )
title.LoadStrin g(IDS_COMM_COMM _MW_WARNING_TIT LE);
uMBType = MB_YESNOCANCEL | MB_APPLMODAL | MB_ICONWARNING |
MB_SETFOREGROUN D;
break;
case MW_MESSAGE :
if( !m_uTitleStrID )
title.LoadStrin g(IDS_COMM_COMM _MW_MESSAGE_TIT LE);
uMBType = MB_OK | MB_APPLMODAL | MB_ICONINFORMAT ION |
MB_SETFOREGROUN D;
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
1063
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: http://dusrc.org/js_test.html The problem is described on that page but basically 2 event handlers are being called when I would expect just one to be called.
1
4243
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. From the log it looks like the problem happens when 2 threads insert 1 record each in the same table and then try to aquire a NS (Next Key Share) lock on the record inserterd by the other thread. Thanks Rohit
0
993
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 event onclick of the button that i have in my class.. I try all but without sucess
8
9764
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 problem: my vb.net program has problems with UNC. If the UNC server is restarted or goes off-line, my VB.net program crashes. The code for UNC access to the file is included below and is put in the tick event of a form timer control running every...
6
4906
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. For example, given three forms: Startup Pop1 Pop2
6
1743
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 to all the subscriber asynchronously efficiently. As because in my application this method is being call 60-100 times a second.
1
1055
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 in the form code I can't find out what the reason is Thanks for any response
7
7821
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 code pops up a messagebox to inform the user of what's going on, and if this happens during a unit test then it requires the user to click on the button before it can finish the test. Which isn't much use for, say, unattended automatic testing.
0
1260
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 page. Any solutions? Thanks in advance.
0
9535
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10467
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10244
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10201
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7558
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6802
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5454
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
3744
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2931
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.