Board index » delphi » Program crashing out of graphics mode under Windows NT 4.0

Program crashing out of graphics mode under Windows NT 4.0

I'm using Borland Pascal 7.01 and have written a program that crashes out
of graphics mode when it is run under Windows NT 4.0. The error message
that has been reported to me is:

  The NTVDM CPU has encountered an illegal instruction.
  CS:0000 IP:0077 OP:f0 37 05 Oe 02

It seems that my program leaves the DOS window in which it was running in
graphics mode, without any cursor being visible.

The program works just fine under Windows 95 and Windows 98.

If anyone can suggest a remedy, or define why the problem occurs, please
post the information here.

Note that I have a patched version of the runtime library to fix the
Runtime Error 200 problem. This problem does not occur.

I hope that someone will be able to help me out of this predicament.

Witold
E-mail: witwald...@optusnet.com.au
Remove XE1 if e-mailing.
Send spam to ab...@whitehouse.gov

 

Re:Program crashing out of graphics mode under Windows NT 4.0


Quote
Witold wrote:
> I'm using Borland Pascal 7.01 and have written a program that crashes out
> of graphics mode when it is run under Windows NT 4.0. The error message
> that has been reported to me is:

>   The NTVDM CPU has encountered an illegal instruction.
>   CS:0000 IP:0077 OP:f0 37 05 Oe 02

> It seems that my program leaves the DOS window in which it was running in
> graphics mode, without any cursor being visible.

> The program works just fine under Windows 95 and Windows 98.

> If anyone can suggest a remedy, or define why the problem occurs, please
> post the information here.

> Note that I have a patched version of the runtime library to fix the
> Runtime Error 200 problem. This problem does not occur.

> I hope that someone will be able to help me out of this predicament.

> Witold
> E-mail: witwald...@optusnet.com.au
> Remove XE1 if e-mailing.
> Send spam to ab...@whitehouse.gov

You're sure to have called CLOSEGRAPH before exiting?

Markus

Re:Program crashing out of graphics mode under Windows NT 4.0


Quote
In article <3B37645E.9000...@freenet.de>, Markus Humm <markus.h...@freenet.de> wrote:
>Witold wrote:

>> I'm using Borland Pascal 7.01 and have written a program that crashes out
>> of graphics mode when it is run under Windows NT 4.0. The error message
>> that has been reported to me is:

>>   The NTVDM CPU has encountered an illegal instruction.
>>   CS:0000 IP:0077 OP:f0 37 05 Oe 02

>You're sure to have called CLOSEGRAPH before exiting?

Here is the fragment of code that operates when my program moves from
graphics mode to text mode for the final time.

  If GraphicsInitialized then
    begin
    RestoreCRTmode;
    CloseGraph;
    end;

As you can see, I do call CloseGraph. However, after looking at the sample
program that Borland provide for the RestoreCRTmode procedure, I noticed
that they do not call RestoreCRTmode prior to their call to CloseGraph.
This may be the source of the problem, and I will give it a try, as it is
simple to test out the two different cases.

Thanks for your response, Markus. I appreciate it. It may just have put me
on the right track, which is what I needed after not looking at the code
for many, many, months.

I'll report back what I find out as a result of my testing.

Witold
E-mail: witwald...@optusnet.com.au
Remove XE1 if e-mailing.
Send spam to ab...@whitehouse.gov

Re:Program crashing out of graphics mode under Windows NT 4.0


Witold schreef:
Quote

> In article <3B37645E.9000...@freenet.de>, Markus Humm <markus.h...@freenet.de> wrote:
> >Witold wrote:

> >> I'm using Borland Pascal 7.01 and have written a program that crashes out
> >> of graphics mode when it is run under Windows NT 4.0. The error message
> >> that has been reported to me is:

> >>   The NTVDM CPU has encountered an illegal instruction.
> >>   CS:0000 IP:0077 OP:f0 37 05 Oe 02

> >You're sure to have called CLOSEGRAPH before exiting?

> Here is the fragment of code that operates when my program moves from
> graphics mode to text mode for the final time.

>   If GraphicsInitialized then
>     begin
>     RestoreCRTmode;
>     CloseGraph;
>     end;

> As you can see, I do call CloseGraph. However, after looking at the sample
> program that Borland provide for the RestoreCRTmode procedure, I noticed
> that they do not call RestoreCRTmode prior to their call to CloseGraph.
> This may be the source of the problem, and I will give it a try, as it is
> simple to test out the two different cases.

<snip>

CloseGraph means shutting the whole graphics system down (= graph
variables
are no longer accessible and freeing up the occupied memory in
the heap)
and does automatically return to text-mode. 'RestoreCRTmode' is
used to
temporarily leave the graphics system, but keeping it available
to return to.

Since 'GraphicsInitialized' is your own boolean var or function,
it might
be that 'CloseGraph' is not executed at all. Maybe your error is
a result
of shutting down graphics while in text mode. But that seems to
be very
unlikely, since it worked well under Win95/98. Just a
'CloseGraph' without
the 'if' would suffice, I think.

It seems to me that NT4 does not allow as much as the other two.
Maybe you should examine the PIF-properties (if they exist; I
know nothing
of NT) of the program more closely.

Greetings. Huub.

Re:Program crashing out of graphics mode under Windows NT 4.0


In article <3B388E02.B5C94...@iae.nl>, Huub van Dooren <hvdoo...@iae.nl> wrote:

Quote
>CloseGraph means shutting the whole graphics system down (= graph
>variables are no longer accessible and freeing up the occupied memory in
>the heap) and does automatically return to text-mode. 'RestoreCRTmode' is
>used to temporarily leave the graphics system, but keeping it available
>to return to.

>Since 'GraphicsInitialized' is your own boolean var or function,
>it might be that 'CloseGraph' is not executed at all. Maybe your error is
>a result of shutting down graphics while in text mode. But that seems to
>be very unlikely, since it worked well under Win95/98. Just a
>'CloseGraph' without the 'if' would suffice, I think.

I have tried two little test programs, each one based around the example
in the Borland Pascal help file. One version calls RestoreCRTmode before
calling CloseGraph, while the other doesn't. However, it was reported to
me that both of them worked just fine, which might be expected based on
your comments.

Quote
>It seems to me that NT4 does not allow as much as the other two.
>Maybe you should examine the PIF-properties (if they exist; I
>know nothing of NT) of the program more closely.

I don't have any PIF properties set. They should default to some kind of
standard values, as the program works OK in text mode and gets into
graphics mode OK and works OK in graphics mode. It's just the coming out
of graphics mode where the problem seems to occur.

Thanks for your comments, Huub.

All the best,

Witold
E-mail: witwald...@optusnet.com.au
Remove XE1 if e-mailing.
Send spam to ab...@whitehouse.gov

Other Threads