By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,964 Members | 1,810 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,964 IT Pros & Developers. It's quick & easy.

error handling question

P: n/a
in vs2003, this used to work:

try
<code>
catch ex as exception
msgbox "Error: " & ex.message
end try

in vs2005, this does not seem to throw a message box up, even tho it does
make it in the catch...when i try to examine the "ex" variable, it says it
is not declared in the current scope. why is this? It kind of makes it
hard to debug if i cant examine the exception object.

any suggestions?

thanks!
g hardy
Jul 13 '07 #1
Share this Question
Share on Google+
2 Replies


P: n/a
"George Hardy" <no****@nospam.comschrieb
in vs2003, this used to work:

try
<code>
catch ex as exception
msgbox "Error: " & ex.message
end try

in vs2005, this does not seem to throw a message box up, even tho it
does make it in the catch...when i try to examine the "ex" variable,
it says it is not declared in the current scope. why is this? It
kind of makes it hard to debug if i cant examine the exception
object.

any suggestions?
What else happens instead of the message box? Does the code continue after
the End Try? If not, what's the callstack if you press Ctrl+Break?
In general, it should work; as it does here.
Armin

Jul 13 '07 #2

P: n/a
"George Hardy" <no****@nospam.comschrieb im:
in vs2003, this used to work:

try
<code>
catch ex as exception
msgbox "Error: " & ex.message
end try

in vs2005, this does not seem to throw a message box up, even tho it does
make it in the catch...when i try to examine the "ex" variable, it says it
is not declared in the current scope. why is this? It kind of makes it
hard to debug if i cant examine the exception object.
It should work too in VB 2005. On my machine it just works fine, the
message is shown and I can examine the 'ex' variable in the debugger when
placing a breakpoint on the 'MsgBox' call.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

Jul 14 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.