473,394 Members | 1,752 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,394 software developers and data experts.

catching Microsoft.JScript.JScriptException

bB
I am calling an external dll (compiled JScript) from within a
try/catch/finally block in a C# program and am unable to catch exceptions
being raised in the JScript dll by having a specific 'JScriptExcepton' catch
block. I can't work out why this is.

If I have a general catch block that catches exceptions of type 'Exception'
and print out the type of the exception, it correctly states that the type
is 'Microsoft.JScript.JScriptException'.

I have worked around the problem by doing a string comparison as follows:

catch (Exception ex)
{
hasErrors = true;

errorString +=
"An unexpected error has been encountered\n" +
"whilst processing the entry for '" +

productPackageItem["Description"] + "':\n\n";

//For some reason, exceptions of type "Microsoft.JScript.JScriptException"
//are not being caught with a seperate catch handler, and a comparison
using
//ex.GetType() against this exception class are also not working. A string
//comparison seems to be the only way of differentiated it...

if (ex.GetType().ToString() == "Microsoft.JScript.JScriptException")
{
errorString += "There is an error in the dimension formula\n\n";
}

errorString += "\"" + ex.Message + "\"";
}

What am I missing?

Tim.
Nov 15 '05 #1
0 1202

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

Similar topics

4
by: Bill Cousert | last post by:
I have a Windows Form that uses the Microsoft WebBrowser control. If I load an HTML file into the control that contains Jscript code, can the Jscript code call a C# function in my Windows Form? ...
39
by: tydbowl | last post by:
I have a problem where the below code chunk causes handle leaks on some machines. The leak APPEARS to be handles to the registry key: HKCU\Software\Microsoft\Windows\CurrentVersion\Internet...
102
by: Xah Lee | last post by:
i had the pleasure to read the PHP's manual today. http://www.php.net/manual/en/ although Pretty Home Page is another criminal hack of the unix lineage, but if we are here to judge the quality...
7
by: VK | last post by:
Something *big* is cooking: the entire Microsoft JScript section is down: <http://msdn.microsoft.com/library/default.asp?url=/library/en-us/script56/html/js56jslrfjscriptlanguagereference.asp> ...
14
by: Xah Lee | last post by:
sometimes in the last few months, apparently Microsoft made changes to their JavaScript documentation website: ...
2
by: Eric Lilja | last post by:
Hello, consider this complete program: #include <iostream> #include <string> using std::cout; using std::endl; using std::string; class Hanna {
2
by: namewitheldbyrequest | last post by:
I created a web service that includes the statement: using Microsoft.JScript; so I can use the eval methods. The Web Service won't build: Error 1 The type or namespace name 'JScript' does...
6
by: Giulio Petrucci | last post by:
Hi there, as I need to share a .NET context with a JavaScript context and I can't re-write Rhino in C# ;-) I'trying to understand something about the Microsoft.JScript namespace, but - really -...
13
by: VK | last post by:
04.01.07 Redmond, WA Today it was officially announced that Microsoft is planning to discontinue client-side JScript support effective 10.08.07 The engine will be blocked and removed on the...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
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,...
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...

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.