The information in this article applies to:
SYMPTOMSWhen attempting to compile an application written in C++ that contains a based pointer initialized at global scope, the compiler incorrectly returns the error message where xxxx is the segment on which the pointer is based. This error does not occur for based pointers that are initialized at function scope. RESOLUTIONSample Code 1With the 16-bit compilers listed above, this error can be eliminated by typecasting the constant that is used to initialize the based pointer to a type "_based(void) *". The following code demonstrates how to generate the compiler error as well as the workaround:
Sample Code 2In the 32-bit compiler for Windows NT, version 8.0, the workaround given for the 16-bit compilers does not work. The "_based(void) *" cast generates the following two error messages if you are using the 32-bit compiler:In this case, the file scope based pointer cannot be declared and initialized in one step. An appropriate workaround would be to declare the pointer at file scope and initialize the pointer inside of a function. The following code demonstrates how to generate the compiler error as well as the workaround:
STATUSMicrosoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. Additional query words: kbVC400bug 8.00 8.00c 9.00
Keywords : kbCompiler kbCPPonly kbVC kbVC500bug |
Last Reviewed: April 15, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |