# problems

Output problems under Win32 with GDI

Problem
PTC programs built for Win32 cause mode switches on program start and exit, lock up when the display window is resized, or fail display to display any graphics showing a black window.

Solution
These bugs existed in PTC 0.60 and have been fixed in version 0.61. If you are experiencing any of these problems please upgrade to a newer version of PTC.

Old PTC programs crash when rebuilt with the new PTC

Problem
Programs written using older versions of PTC (0.53 and earlier) crash when rebuilt with PTC version 0.60 or greater.

Solution
This problem occurs because surface allocation changed greatly in version 0.60. Surfaces can no longer be assumed to be linear blocks of memory, now they can be either topdown or bottomup surfaces, and may have an "advance" of x bytes between each line. To make old programs work it is required to use the surface "pitch" to move from the start of one line to the next. For an example of how to work with these changes see the "rand32.cpp" example program.

PTC programs lock up or reset computer when run

Problem
Programs built with PTC crash when executed, locking up or resetting the computer.

Solution
A number of things can cause this. The most common cause is a bug in your code, check to make sure that you are staying in bounds of surface memory and not reading/writing anywhere outside the surface memory by mistake. Another common problem is having a stack that is too small. PTC can get quite stack intensive so make sure you have at least 64k of stack allocated. This is especially important with Watcom C++ which has a very small default stack size. A less common cause is a UniVBE bug on some cards (reported on S3 Trio 64+ with UniVBE 5.3). You can fix this by upgrading to the latest version of SciTech Display Doctor from www.scitechsoft.com.

Black screen on ET6000

Problem
PTC programs show a black screen when run on a system with an ET6000 based video card.

Solution
This problem only occurs when the user is running UniVBE 5.3 (SciTech Display Doctor). This is a confirmed bug in UniVBE and is not a bug in PTC. The problem only occurs with 32bit display modes, all other modes set correctly. The best solution is to upgrade to a more recent version of SciTech Display Doctor (available from www.scitechsoft.com). Another solution is disable univbe (type "univbe off") before running the program. Alternatively the user can specify a different pixel format to use on the command line. For example "demo RGB888" will fix the problem by forcing a 24bit display mode, but only if the program author has allowed command line PTC initializing (see the "image.cpp" example program to find out how to do this).

pmode/w bug under NT

Problem
PTC programs built with Watcom C++ and bound with pmode/w crash when run under NT.

Solution
It seems that pmode/w has bugs that cause it to crash under NT when interfacing to the VESA bios. Programs bound with pmode/w crash when using VESA under NT, but operate fine using VGA under NT, and both VGA/VESA on DOS and Win95. The only way to fix this is not to use pmode/w.

DJGPP crash under NT

Problem
PTC programs built with DJGPP crash when run under NT.

Solution
PTC uses near pointers to access VGA and VESA display memory. DJGPP does not support near pointers under NT, and will crash if they are used. If your programs must run under NT, consider switching to Watcom C++ which operates perfectly under the NT dos box, or build a native Win32 application.

Problems with DJGPP + PTC + Midas + Allegro

Problem
Trying to use PTC with Allegro and Midas under DJGPP results in compile errors, link errors and program crashes.

Solution
Old versions of PTC used the variable "__crt0_startup_flags" to enable near pointers under DJGPP. This caused conflicts with Midas and Allegro, which both try to do their own setup using the same variable. This problem was fixed in version 0.60.

Strange output window under Watcom C++

Problem
PTC Win32 programs built with Watcom C++ have a strange display window which doesnt have an entry in the taskbar.

Solution
This problem was fixed in version 0.61. Upgrade to a newer version of PTC.

Image loading fails under Watcom C++ 10.x

Problem
In PTC programs built for DOS with Watcom C++ 10.5 and 10.6 image loading can sometimes fail randomly.

Solution
This problem occurs because of an i/o bug in the Watcom runtime library. This problem was fixed in PTC 0.61.

Windows are created without focus

Problem
When PTC::Init or PTC::SetMode are called more than once under a Win32 console application, the output window is created without input focus.

Solution
The Win32 API seems to behave strangely with windows created in a console application. This problem shows up with the "profile.cpp" example program. If you switch to a native windowed application (WinMain) this problem will not occur. If you have any information that could help me fix this problem please contact me.

Other problems...

If you have any other problems using PTC as a programmer or end user please contact me.