The information in this article applies to:
SUMMARYThe Microsoft Professional Advisor Library version 1.0 includes a sample program (MHTEST.EXE) that demonstrates basic use of the help system API. However, this program example was written for OS/2 and there is no MS-DOS example included in the package. The sample code provided below demonstrates how to use the help system functions under MS-DOS. MORE INFORMATION
The MHTEST.EXE example is built from two source files, HTEST.C and
HELPBACK.C. HTEST.C is a sample front-end application that interfaces
with the library functions. HELPBACK.C is a sample set of call-back
functions, which the library functions require you to have in your
code. Both of these files are written for OS/2 (utilizing OS/2 API
calls) and will not compile and link explicitly for MS-DOS; however, the
program will run under either MS-DOS or OS/2 if it is compiled and linked
for OS/2 and then bound for MS-DOS.
If you are developing an MS-DOS application, you must provide some call-back functions. These call-back functions are involved with opening and closing files, reading data from a file, allocating and deallocating memory, and locking and unlocking memory. The help library imposes this burden upon the programmer because of the limited resources available under MS-DOS. If the help engine were to use the standard malloc or _dos_allocmem functions to obtain memory for itself, it would probably find itself running out of memory if it were embedded into a large program, or possibly conflicting with the program's own memory management scheme. For example, many large programs manage their memory using a virtual memory management scheme. By forcing the application to provide call-back functions to control memory allocation, the help engine never intrudes on the application's own memory management scheme.It is important to note that the sample routines provided below are only simple templates for the type of functions needed; they do not include any error checking or error-handling capabilities. The sample routines are written for use with the large and compact memory models and will require some minor modifications to avoid compiler warnings under the small or medium models. Sample Code
Additional query words: kbinf 1.00 helpmake callback TlsMisc
Keywords : kb16bitonly |
Last Reviewed: October 29, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |