home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
sftick.zip
/
SFTIC.DOC
< prev
Wrap
Text File
|
1994-05-05
|
7KB
|
133 lines
OS/2 Programming Pitfalls for Beginners
Kathleen Panov
San Francisco Technical Interchange
INSTRUCTIONS
There are nine sample applications contained in the folders on the desktop. Each folder contains a
file "COMPILE.CMD" that will compile the program and redirect the compiler output to the text file
"OUT". There is also a file, "RUN.CMD" that will execute the sample application. Each program
demonstrates a common OS/2 programming error. You will be given 8 minutes per program to find
the problems. Two hints will be displayed at 2 minute intervals. The last hint will contain the
solution. If you get too frustrated, there is a "GOOD" folder that contains the solution. Look for the
"BINGO" icon and search in the file for the keyword "BINGO".
MEM
Memory and the Trap of Doom
You have a program that needs to allocate some memory and then write to it. However, you seem
to be running into a trap! Your job is to find the problem, and correct it so you may safely write to
the allocated memory.
WIN2
The Dormant Dormer
This program's only function is to create and window and have it display on the desktop. The
window seems to have a mind of its own, and will not appear. You must discover why the window is
not appearing and modify the program so the window will appear.
DIALOG
The Case of the Missing Frame
Select "Load Dialog..." from the DIALOG menu. A dialog will appear but... where's the frame?
Your mission if you choose to accept it is to find the reason the frame is missing, and fix the
program so the frame is visible.
WIN3
The Run-Away Window Procedure
This program's only function is to create a window and have it display on the desktop (Gee, this
sounds familiar, doesn't it ). Unfortunately, the window seems to have some kind of error. Your job
is to find out what is causing the error, and make the window reappear!
FILE
The Mysterious Unopened File
The file program's only function is to open a file "FILE.BAK" and close a file. However, it seems to
be temperamental and will not work. You must find the reason the file will be open and modify the
program so the file open and close are successful.
WIN4
In Search of Broken Windows
This program's only function is to create a window and have it display on the desktop (I know, I
know, but this one is different, I promise). The program runs, but immediately exits. Inquiring
minds want to know why. Your task is to find the reason, and create a successful program.
SLIDER
The Disappearing Tick-Mark Text
This program should display a slider control and have tick-marks that are labeled with percentages.
However, for some reason the text is invisible. Your mission is to find the problem and put the
missing text in its proper place.
PROG
The Search for the Long Lost Listing
This program is designed to execute the OS/2 command processor (CMD.EXE) and have it print out
a directory listing. However, it doesn't print out a listing like it is supposed to. Your task is to fix
this program so a command process is started and the directory listing is displayed.
WINFONT
The Tell-tell Typeface
This program has text that should appear on the window in 18 point Times Roman (This is
written in 18 pt Times Roman). There is a small problem, and the font change does
not appear to have taken effect. You must make the text appear in 18 point Times Roman.
OS/2 Programming Pitfalls for Advanced Programmers
Kathleen Panov
San Francisco Technical Interchange
INSTRUCTIONS
There are seven sample applications contained in the folders on the desktop. Each folder contains a
file "COMPILE.CMD" that will compile the program and redirect the compiler output to the text file
"OUT". There is also a file, "RUN.CMD" that will execute the sample application. Each program
demonstrates a common OS/2 programming error. You will be given 10 minutes per program to
find the problems. Two hints will be displayed at 2 minute intervals. The last hint will contain the
solution. If you get too frustrated, there is a "GOOD" folder that contains the solution. Look for the
"BINGO" icon and search in the file for the keyword "BINGO".
TITLEBAR
The Trouble with the Title bar Text
This is a very small program that simply brings up a window and changes some of the colors on the
title bar. There is one small problem, the title bar text seems to have vanished. Your mission is to
return the text to its proper place.
GUARD
The Mysterious Excepting Exception
This program is a guard page exception handler that will generate a guard page exception, trap the
exception in the exception handler, commit the trapping page of memory, and set the next page as
the new guard page. Everything seems to work fine until the program ends, then a stack exception
appears. What is the problem? Your task is to discover why the exception appears and get rid of it.
FONTDLG
The Disappearing Dialog Display
This program has a "Change Font..." selection that will bring up on of the OS/2 Common Dialogs,
the Font Dialog. The dialog seems to display OK, but some of the elements are missing. Your
mission is to find the reason the dialog display disappears and fix it so all will be shown...
MEM
The Invisible Shrinking Memory Pool
On the surface, this program has no problems; but, it does have a problem that would show up if
this program was a lot bigger. There are two programs - SHARED and SHAREE. SHARED
allocates some shared memory and then spawns the program SHAREE, which will get the shared
memory and write it to the screen. Trouble is just around the corner... Your task is to find the
problem, correct it, and make the world safe for ignorant users everywhere.
CONTAIN
The Case of the Cantankerous Container
This program should bring up a container with several records, each sorted in alphabetical order.
However, you seem to be running into a trap! Your job is to find and correct the problem so the
container will come up, and the records are sorted in alphabetical order.
POPUP
The Lurking Leak of Doom
This is a very small program that will display a popup menu when the user clicks the right mouse
button (context menu button) on the icon. There is also a THESEUS2 display that shows changes
in the amount of memory allocated and committed. Some memory seems to be missing. You must
find the leak and stop it, before it's too late!
OBJECT
The Slider that Would Not Die
This program is a two-threaded program that brings up a progress indicator (slider) of a
background file copy process. Everything seems OK until the program is closed, and it never seems
to go away. You must find the secret weapon that will kill the slider, and fix the program so the
slider process is well and truly dead.