Microsoft KB Archive/63052

= FIX: PWB 1.0 Extensions Will Only Return True Under MS-DOS =

Article ID: 63052

Article Last Modified on 10/23/2003

-

APPLIES TO


 * Microsoft Programmer's Workbench for MS-DOS 1.0
 * Microsoft Programmer's Workbench for OS/2 1.0

-



This article was previously published under Q63052



SYMPTOMS
Extensions written for use by the Programmer's WorkBench (PWB) version 1.0 under the DOS operating system are recognized as returning true regardless of their actual return values.



STATUS
Microsoft has confirmed this to be a problem in PWB version 1.0. This problem was corrected in PWB version 1.1.



MORE INFORMATION
The use of return values as a way of providing conditional jumps inside PWB macros is a common practice that is affected by the above limitation for PWB extensions. The sample extension and macros below demonstrate the above problem. Once installed, both the f1 and f2 functions will be seen as returning true to PWB.

Sample Code
// TEST.C


 * 1) include 
 * 2) include 
 * 3) include 

PWBFUNC f1( unsigned argData, ARG far *pArg, flagType fMeta ); PWBFUNC f2( unsigned argData, ARG far *pArg, flagType fMeta);

// Switches. struct swiDesc swiTable[] = {  { NULL, NULL, 0 } };

// Commands. struct cmdDesc cmdTable[] = {  { &quot;f1&quot;, f1, 0, NOARG }, { &quot;f2&quot;,f2,0, NOARG }, { NULL, NULL, 0, 0 } };

void EXTERNAL WhenLoaded {   SetKey( &quot;f1&quot;,         &quot;alt+f&quot; ); SetKey( &quot;f2&quot;,      &quot;ctrl+f&quot; ); return; }

PWBFUNC f1( unsigned argData, ARG far *pArg, flagType fMeta ) { return(FALSE); /* FALSE is defined as 0 in ext.h */ }

PWBFUNC f2( unsigned argData, ARG far *pArg, flagType fMeta) { return(TRUE);  /* TRUE is defined as 1 in ext.h  */ }

// End of TEST.C

Sample Macros

 * sample macros for TOOLS.INI to test f1 and f2

load f1

test:=f1 ->loc1 arg &quot;true&quot; message => :>loc1 arg &quot;false&quot; message test2:=f2 ->loc2 arg &quot;true&quot; message => :>loc2 arg &quot;false&quot; message

test:alt+t test2:ctrl+2

Additional query words: 1.00 buglist1.00 fixlist1.10

Keywords: kbfix kb16bitonly KB63052

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.