|
. Thanks.
286? WOWW!
|
|
|
|
|
That is strange code. It's normally done like this:
int main()
{
int i=3;
__try
{
i=i/0;
}
__except(EXCEPTION_EXECUTE_HANDLER)
{
printf("Gotcha!");
}
_getch();
return 0;
}
Or even better:
bool IsDivideByZero(DWORD code)
{
return code==EXCEPTION_FLT_DIVIDE_BY_ZERO || code==EXCEPTION_INT_DIVIDE_BY_ZERO;
}
int main()
{
int i=3;
__try
{
i=i/0;
}
__except( IsDivideByZero(GetExceptionCode()) ? EXCEPTION_EXECUTE_HANDLER : EXCEPTION_CONTINUE_SEARCH )
{
printf("Gotcha!");
}
_getch();
return 0;
}
Steve
|
|
|
|
|
This is quite clear! Thanks Stephen
286? WOWW!
|
|
|
|
|
In standard C++ catch(...) will not catch hardware exception by design: divide by zero should not be caught by your code on standard compliant compilers. MSVC6 was non standard in this area (and many, many others). Later MS compilers fixed this bug but provides the /EHs[^] switch to use the old buggy exception handling semantics. In short, using catch (...) like this is a worry (I'm of the opinion that you should almost never use it anyway).
Steve
|
|
|
|
|
How can I write something somilar to a MDI application (using Visual Studio) where:
*Document is write in C++ to have fast routines
*View/ frames/ menu /other grafic tools are writed with a different lenguage (as C# or VB NET) to use in a more easy and fast way objects like image editing tools/data tables/... (and ... to split this job with other people)
Can .NET help me?
any articles that shows detailed procedures?
any lectures?
thanks
Cheers,
Russell
|
|
|
|
|
Hi!
In runtime suppose I want to identify the handle of one main window and the child controls window like combo,listview and button which is inside the main window. How can I check whether it is main window handle and it is control window handle?
Amit Mistry - petlad -Gujarat-India
|
|
|
|
|
Have a look at IsChild function.
|
|
|
|
|
In VC++ when we assigning the port number to the socket programming ,how to check wheather the port number was already exiting or not
shakumar
|
|
|
|
|
I would think the connection would return something like WSAEADDRINUSE .
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
hi there,
I'm wondering on how to expand the dialog box vertically automatically as the item display in a cwnd custom control is bigger than the original size. Are there any good ideas?
TQ.
|
|
|
|
|
Explore dilaog[^] section on CP, check if you get any help there. I remembered reading some article of resizable dialog.
|
|
|
|
|
Your question is a bit unclear. Are you saying that a control on the dialog is larger than the dialog itself?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
when some drawing displayed in the custom control become vertically larger than the original size of the custom control(this happen maybe through zooming in), what should i do in order to enlarge the dialog and the custom control in the dialog box in order to be able to view the drawings without scrolling?
|
|
|
|
|
cyn8 wrote: control is bigger than the original size
How do you create them?
|
|
|
|
|
i add a custom control in the dialog using resource editor and registering it. It is CWnd generic based class.
|
|
|
|
|
I have placed cxSkinbutton on dialog with bmp on it.but it does not look like normal button that is i cant recognize the button is clicked or not.it just look like image.
plz help me.
|
|
|
|
|
ask the question in the forum at the bottom of the article
|
|
|
|
|
IF you want to use Bimap on a button you can of CBitmapButton
|
|
|
|
|
damn, won't you never read the other answers before posting ???
|
|
|
|
|
I've created a single dialog based application.
In the dialog box i am using a textbox.
Now i want to trap when Escape key pressed in the textbox.
When i press the Esc key the OnCancel virtual function of the CDialog called
which terminates the application.
Viral Joshi.
|
|
|
|
|
Doesn't the answer to your previous[^] thread satisfies your query.
|
|
|
|
|
viral_umang@hotmail.com wrote: I've created a single dialog based application.
In the dialog box i am using a textbox.
Now i want to trap when Escape key pressed in the textbox.
When i press the Esc key the OnCancel virtual function of the CDialog called
handle PreTanslateMessage virtual function
|
|
|
|
|
I have down loaded BinRes class from CP.
I am getting the following errors while compiling it.
--------------------Configuration: TestAllApp - Win32 Debug--------------------
Compiling...
TestAllAppDlg.cpp
d:\program files\microsoft visual studio\vc98\include\new(35) : error C2061: syntax error : identifier 'THIS_FILE'
d:\program files\microsoft visual studio\vc98\include\new(35) : error C2091: function returns function
d:\program files\microsoft visual studio\vc98\include\new(35) : error C2809: 'operator new' has no formal parameters
d:\program files\microsoft visual studio\vc98\include\new(36) : error C2061: syntax error : identifier 'THIS_FILE'
d:\program files\microsoft visual studio\vc98\include\new(37) : error C2091: function returns function
d:\program files\microsoft visual studio\vc98\include\new(37) : error C2556: 'void *(__cdecl *__cdecl operator new(void))(unsigned int,const struct std::nothrow_t &)' : overloaded function differs only by return type from 'void *(__cdecl *__cdecl op
erator new(void))(unsigned int)'
d:\program files\microsoft visual studio\vc98\include\new(35) : see declaration of 'new'
d:\program files\microsoft visual studio\vc98\include\new(41) : error C2061: syntax error : identifier 'THIS_FILE'
d:\program files\microsoft visual studio\vc98\include\new(42) : error C2091: function returns function
d:\program files\microsoft visual studio\vc98\include\new(42) : error C2556: 'void *(__cdecl *__cdecl operator new(void))(unsigned int,void *)' : overloaded function differs only by return type from 'void *(__cdecl *__cdecl operator new(void))(unsig
ned int)'
d:\program files\microsoft visual studio\vc98\include\new(35) : see declaration of 'new'
d:\program files\microsoft visual studio\vc98\include\new(42) : error C2809: 'operator new' has no formal parameters
d:\program files\microsoft visual studio\vc98\include\new(42) : error C2065: '_P' : undeclared identifier
Error executing cl.exe.
TestAllApp.exe - 11 error(s), 0 warning(s)
what could be the problem? Please help.
Thank u.
KIRAN PINJARLA
|
|
|
|
|
why don't you tell it to the author of the article direclty using the forum at the bottom of the article ?
|
|
|
|
|
Hello friends. I have a progam which needs to call different programs. So, if anyone of you know how to call different programs from a program during runtime, please do let me know....
Thank you(in anticipation)
MaliniNair
|
|
|
|