Re: ScriptEngine (VB) sometimes fails a division under Windows Server

Tech-Archive recommends: Fix windows errors by optimizing your registry



Probably MS product support is the address for this question.
You should have few support incidents with the MSDN subscription.

--PA

"T G" <tg@xxxxxxxxxxxxxxxxx> wrote in message news:5C652FC7-CEF1-4847-B4FA-261E46079198@xxxxxxxxxxxxxxxx
I'm not sure what section I should put my problem in, so if this is wrong
please point me to the right one.

I have an MFC C++ program which runs a Script Engine on application and
document basis (uses interfaces ActiveScriptSite and ActiveScriptSiteWindow).
It uses VBScript. The following lines of code creates the engine:

CLSID CLSID_VBScript =
{ 0xb54f3741, 0x5b07, 0x11cf, { 0xa4, 0xb0, 0x00, 0xaa, 0x00, 0x4a, 0x55,
0xe8 } };

// create script engine
HRESULT hr = CoCreateInstance(clsidScriptEngine,
NULL, // no aggregation
CLSCTX_INPROC_SERVER,
IID_IActiveScript,
(LPVOID*)&m_pActiveScript);

I have a document in my program that loads a script and runs it. The script
works perfect under Windows XP for example.

But when the script runs under Windows Server 2003 it sometimes seems to
break parts of the engine for some reason. The script can work as expected
for a while, but sometimes it breaks. When this has happened, every line of
code that makes a division fails and I get an error message telling me
"Overflow" when an division is executed. For example this gives me an
overflow message after the engine have stopped working correctly:

Dim test
test = 4 / 2

This does NOT give me an error:

Dim test
test = 4 \ 2

So it seems to be connected to floating points operations.

Once the engine fails to work as intended, the only thing that helps is to
restart the program. It is not enough to open a new document that creates a
new script engine.

My program is built under Visual Studio 2005.

I have an older copy of the program built under Visual Studio .NET 2003 and
it seems like that executable does not break the engine. Are there any
changes in VS 2005 that may cause this error on Win2003 Server? Since the exe
built under VS 2003.NET seems to work.

I have made some research without getting any answers to my problem.
Hopefully someone can give me a hint.

I know my description may be to vague, so feel free to ask for more
information.

Thanks in advance! /TG


.



Relevant Pages

  • Re: Adding script functions in the host application
    ... > to have only one instance of the macros for many engine instances. ... it creates a single script engine for a page (well, actually, a script ... engine for every language used on a page) and then calls ParseScriptText ...
    (microsoft.public.vc.atl)
  • Re: Multithreaded script host doesnt like Apartment threaded objects
    ... >> engine whenever another thread needs the same script. ... I do not marshall interface pointers between apartments, ... Now all your threads run in the same apartment, ...
    (microsoft.public.win32.programmer.ole)
  • Re: Unable to throw exception from method in encoded JS
    ... encoded script engine when they encounter encoded script". ... the unstable nature of that engine is not worth the trouble. ... but other operations and tests fail. ... are lots of decoders on the net. ...
    (microsoft.public.scripting.wsh)
  • Re: MySQL
    ... Then you can use it from inside MySQL or on the commandline ... it is crying out for a script wrapper to make it more flexible. ... you have the option to use a csv engine. ... So you can now select from your dbase files into a csv file. ...
    (alt.os.linux.suse)
  • Re: Volunteers restore Brighton Belle
    ... However was refering to the current day experience of travelling behind a Princess. ... As long as the coach is not sealed thus allowing the smell and sound of the engine to reach a passenger then a MK1 is emminently suitable to complete the experience of a Princess instead of a 'foriegn' engine. ... that it was built recently. ... the right file folder. ...
    (uk.railway)