Maintaining PWB Display While Running a ProgramLast reviewed: July 17, 1997Article ID: Q81321 |
1.00 1.10 2.00 | 1.00 1.10
MS-DOS | OS/2kbtool kbcode The information in this article applies to:
SUMMARYThis article discusses how to run a program in the background with the Programmer's WorkBench (PWB) versions 1.0 and 1.1, much like NMAKE and other utilities do. Although this method also works for version 2.0 of PWB, we recommend that you use the newer callback, DoSpawn(), instead.
MORE INFORMATIONThe best way to do this is to use PWB's compile command. First build a string of the form:
"arg arg \"progname.exe arguments for exe \" compile"Then pass the string to fExecute(). To demonstrate this, without having to write an extension, do the following in PWB:
load:[extension].mxt funcname:alt+z If you are working under OS/2 rather than MS-DOS, you should use .PXT instead of .MXT as the file extension. It is important to note that you must force PWB to load your extension before you assign a keystroke to your function. PWB will recognize your function only after the extension is loaded, and since extensions are loaded after the TOOLS.INI, you cannot rely on PWB's automatic loading of extensions. MORE information about PWB extensions can be found in Chapter 8 of the "Microsoft C Advanced Programming Techniques" manual, the online help, and in Chapter 9 of the C versions 6.x "Developers Toolkit Reference."
Sample Code
/* Compile and link options needed: cl /c /ACw /Gs [extension].c To link for MS-DOS: link /NOI exthdr.obj [extension].obj, [extension].mxt; To link for OS/2: link /NOI exthdrp.obj [extension].obj, [extension].pxt,,, ext.def; */ #include "ext.h" /* function prototype */PWBFUNC funcname ( unsigned argData, ARG _far *pArg, flagType fMeta); /* Switch description table (required for an extension) */struct swiDesc swiTable[] = { { NULL,NULL,0}};
/* Command description table ( required for a PWB extension) */struct cmdDesc cmdTable[] ={ { "funcname", funcname, 0 , NOARG}, { NULL, NULL, 0, 0}}; /* Function that PWB calls when loading the extension */ void EXTERNAL WhenLoaded(void){ DoMessage("Loading funcname extension");} PWBFUNC funcname ( unsigned argData, ARG _far *pArg, flagType fMeta){ char c[] = "arg arg \"set\" compile"; fExecute(c);}
|
Additional reference words: kbinf kbinf extension 1.00 1.10 2.00 PWBIss
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |