Carlos_zxl

I am doing the migration of a project from vc6 to vs2005, and it include dapi.h which could not be found in vs2005's installation folder. I have installed Exchange Server 2007 SDK, but it could not be fould too.

So i just use the files under vc6 folder, but there is another error:

error C2628: 'BOOL' followed by 'bool' is illegal (did you forget a ';' )

It is caused by the following line:

BOOL bool;

What should I do



Re: Visual C++ Express Edition Where is Dapi.h and Dapi.lib in VS2005

nobugz

If it is not in the 2007 SDK, you might need an earlier version. Post at an Exchange newsgroup at www.microsoft.com/communities

"bool" is a keyword. Your statement would post-process to something like "int bool", not a valid declaration. Just rename it to something else.





Re: Visual C++ Express Edition Where is Dapi.h and Dapi.lib in VS2005

Carlos_zxl

nobugz wrote:
If it is not in the 2007 SDK, you might need an earlier version. Post at an Exchange newsgroup at www.microsoft.com/communities

"bool" is a keyword. Your statement would post-process to something like "int bool", not a valid declaration. Just rename it to something else.

Thank for your reply!

Vs2005 could recognize bool as a datatype, isn't it I don't know why the following code could be compiled in vc6:

BOOL bool;

Doesn't vc6 recognize bool

What do you mean is to modify the source file of Dapi.h Indeed I just comment this line to avoid the error.





Re: Visual C++ Express Edition Where is Dapi.h and Dapi.lib in VS2005

Jonathan Caves - MSFT

Visual C++ 6.0 may be ancient but it did sort of recognize bool: the version I have (once I've blown the dust of it) does complain about:

Code Block

typedef int BOOL;

BOOL bool;

but allows:

Code Block

typedef int BOOL;

struct A

{

BOOL bool;

};

Note: assuming your problem is with the a member of a struct/class then the correct fix is NOT to comment out the line - doing this will change the size of the struct/class and could lead to hard to debug runtime crashes. The better fix is, as was stated above, to change the name. Something as simple as:

Code Block

typedef int BOOL;

struct A

{

BOOL _bool;

};






Re: Visual C++ Express Edition Where is Dapi.h and Dapi.lib in VS2005

Carlos_zxl

Yes, you are right! the more complete code is as following:

Code Block
typedef union _DAPI_VALUE
{
LPSTR pszA;
LPWSTR pszW;
#ifdef UNICODE
LPWSTR pszValue;
#else
LPSTR pszValue;
#endif
LPBYTE lpBinary;
INT iValue;
BOOL bool; //Here is the problem!
} DAPI_VALUE, * PDAPI_VALUE;





Re: Visual C++ Express Edition Where is Dapi.h and Dapi.lib in VS2005

nobugz

VC6 was a seriously oddball compiler. The "C++ bug of the month" column was a fun read.