|
Does anyone know of a way to find out what was thrown in a "catch all" catch clause?
The app I'm working on throws all sorts of things in addition to exceptions. I hate having to catch each one.
e.g.
throw TRUE;
throw 3;
throw ErrObject;
Thanks for the help,
Bill
|
|
|
|
|
You can't figure what is cought. That's the catch of catch(...)
|
|
|
|
|
u can combine C++ error handling with C's SEH and u can use SEH to get information abt the exception. Please refer to John Robbins article on SEH and C++ in MSDN Magazine( i forgot the issue ) or his book
Ganesh Ramaswamy
|
|
|
|
|
There's no general way to catch anything throwable inside a try block. However, you can consider the possibility of having your app send an object of generic type, this meaning a class capable of holding values of an undetermined type. This beast indeed exists, and has been implemented in Boost any library (hey, it even works with MSVC++ 6.0). If you follow this approach, all you have to do is replace your throw s with:
throw bost::any(TRUE);
throw boost::any(3);
throw boost::any(ErrObject); Hope this helps.
Joaquín M López Muñoz
Telefónica, Ivnestigación y Desarrollo
|
|
|
|
|
You're probably right about this being the way to go. I was hoping to avoid replacing several hundred assorted throw stmts that are already in the app.
Oh well, Guess I'll get to work!
I appreaciate all the responses.
Thanks for the help,
Bill
|
|
|
|
|
The easiest thing to do is to always throw exceptions using classes that derive from a single "exception" class, similar to how it works in Java. This allows you to always catch any of your exceptions using one
catch(MyBaseException e) statement. I recommend using the std::exception class as your base class.
Regards,
Alvaro
|
|
|
|
|
Thanks for the suggestion. I agree that this is the "best" solution. I was hoping to avoid replacing about 1300 throw's in the existing code base.
Thanks for the help,
Bill
|
|
|
|
|
I don't think I've ever had to cast calls to str{len|cpy| etc..} before.
What's more is that it's an error:
error C2664: 'strlen' : cannot convert parameter 1 from 'unsigned char [256]' to 'const char *'
as used in:
dwLen = strlen(modemInit[i]);
They should be warnings - if anything is to be said at all.
Is there someway for me to set it so I don't have to cast it?
|
|
|
|
|
|
The char type is signed, so an unsigned char* doesn't match a signed char* .
--Mike--
http://home.inreach.com/mdunn/
While I can't be correct on all matters, I can make the reassuring claim that where I am inaccurate, I am at least definitively inaccurate.
your with and
Sonork - 100.10414 AcidHelm
Test out a prerelease build of my Hotfix Checker v2.0! (133K)
|
|
|
|
|
Hello everybody,
Where can i find good information in order to know how to
automate excel throught VC++6.0.
Thanks for help.
S.
|
|
|
|
|
M S D N - thats it
Ganesh Ramaswamy
|
|
|
|
|
How I can use IMAPI classes? After the installation, I haven't seen the file imapi.idl into directory include. So the Visual C++ compiler give me a link error (LNK2001).
Is there someone that can help me?
Thanks.
|
|
|
|
|
Hi,
I write a program to run some CGI Script in some domain in Internet. I use MSHTML.DLL in my program, so if I distribute my program, I'll distribute this DLL too?
|
|
|
|
|
Hi
I tried to get my app to show Euro, but I failed. I'm
using English Windows with Japanese multilanguage
package. By using GetCurrencyFormat(
LOCAL_USER_DEFAULT ...), I managed to get a yen mark,
according to my windows currency setting. Dollar also
normally works. But when I set my currency to Euro, a
question mark is returned. Could anybody please tell me
how to get the Euro character?
Thank you,
Danny
|
|
|
|
|
Microsoft Says:
---------------
(There is a bug in the original release of Visual Studio 6.0. The dialog editor writes the symbol to the .RC file as WS_EX_LAYOUT_RTL rather than WS_EX_LAYOUTRTL. This should be fixed in a future version of Visual Studio.)
-------------------------------------
The Operating system is Window2000 and Tool is VC++ 6.0. When i set the "Right to left allignment property of a dialog box" and error occured "error RC2104 : undefined keyword or key name: WS_EX_LAYOUT_RTL" which means this symbol is not defined. then i checked the microsoft site and i come to know that it is a bug in VC6.0. To fix the bug i used "WS_EX_LAYOUTRTL" instead of "WS_EX_LAYOUT_RTL"as told me by the microsoft site but now compiler says "WS_EX_LAYOUTRTL" is not defined. so what is the solution of this bug.
Have a nice wishes for helper.
|
|
|
|
|
I think you should install SP5
Nish
Sonork ID 100.9786 voidmain
www.busterboy.org
If you don't find me on CP, I'll be at Bob's HungOut
|
|
|
|
|
A look in afxpriv.h shows the define. I guess one of the service packs must have added it for MFC use.
Michael
|
|
|
|
|
You need to make sure you've got the latest version of the platform SDK installed. This has WS_EX_LAYOUTRTL defined.
As a general guide, always make sure you are using the latest platform SDK and don't rely on the include files that ship with Visual Studio.
Michael
|
|
|
|
|
Hello:
I´ve made a program that works with graphics, and it draws them fine with Windows 95, 98 and Millenium. The program detects screen resolution and windows fonts size to resize them to full screen. I used SetMapMode with MM_LOENGLISH coordinates (x with positive values and y with negatives) and it worked fine in screen as well as printed. But this week I have just installed Windows 2000 and the graphics appear in the left corner of the screen with any choosen resolution and smaller than in other Windows versions. In a first time I thought it could be a problem with the drivers of my graphics display card with win2000, but a friend of mine has the same problem.
Could it be the problem the coordinates system ? Do I need to use SetWindowExt , SetViewportExt or similars functions?
Please I need some help because I have distributed the program to many people.
Thanks a lot.
|
|
|
|
|
Anyone have any resources on bandwidth throttling or maybe some sample code?
Stephen Caldwell
Blackfission, CEO
http://blackfission.myip.org:81
Sonork ID: 100.10100
|
|
|
|
|
I have .ocx and .dll files.How can I register them in my computer?
|
|
|
|
|
use regsvr32 to register the ocx/COM dlls
put your non-COM dlls in the program directory or the system directory
Nish
Sonork ID 100.9786 voidmain
www.busterboy.org
If you don't find me on CP, I'll be at Bob's HungOut
|
|
|
|
|
sorry ,I don't know how to use regsvr32??(what do u mean by that?)
|
|
|
|
|
Register Server 32 is an executable in Windows. Type
regsvr32 xxx in run and say OK.
xxx - is file name with path
Ganesh Ramaswamy
|
|
|
|