Home
Dashboard
Directory
Help
Sign in
Microsoft
Connect
Your feedback improving Microsoft products
Search
Feedback
All Connect
Visual Studio and .NET Framework Home
Downloads
Feedback
Surveys
Using x64 with mapidefs.h and sqltypes.h causes C2371
by
Martin Richter
Active
2
1
Sign in
to vote
Type:
Bug
ID:
100721
Opened:
9/8/2005 4:32:48 AM
Access Restriction:
Public
2
Workaround(s)
view
0
User(s) can reproduce this bug
If you create a project with x64 and include
Using x64 with mapidefs.h and sqltypes.h causes C2371.
Details
(
expand
)
Product Language
English
Version
Visual Studio 2005 Beta 2
Category
Libraries
Operating System
Windows XP Professional
Operating System Language
German
Steps to Reproduce
Create 64bit project. Include mapidefs.h and sqltypes.h. (Both files are from the SDK)
Actual Results
Compiler error:
D:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\mapidefs.h(1142) : error C2371: 'BOOKMARK' : redefinition; different basic types
D:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\sqltypes.h(283) : see declaration of 'BOOKMARK'
Expected Results
Should compile!
File Attachments
0 attachments
Comments (5)
Workarounds (2)
Sign in
to post a comment.
Please enter a comment.
Posted by
EmilOtt
on 12/22/2010 at 1:35 AM
Hello Master Richter,
it is spelled BOOKMARK and not BOOMARK!!!!!!!!!!! Booooooo
#undef BOOKMARK
#define BOOKMARK MAPI_BOOKMARK
#include <mapidefs.h>
#undef BOOKMARK
#define BOOKMARK SQL_BOOKMARK
#include <sqltypes.h>
#undef
Posted by
EmilOtt
on 12/22/2010 at 12:33 AM
Your workaround does not work for me!
Posted by
EmilOtt
on 12/22/2010 at 12:31 AM
5 years and no fix. Damn, what a speed!
Hello somebody in there?
The plebs outside are still waiting for a fix!
Posted by
Mike
on 10/4/2010 at 9:13 PM
still happens in late 2010. not exactly ASAP.
Posted by
Microsoft
on 9/9/2005 at 11:02 AM
Thank you for your input. We have forwarded this issue to the Platform SDK Team which owns these files. They will address these issues ASAP. Thank you again for your comments.
Sincerely yours,
.NET Framework SDK
Sign in
to post a workaround.
Please enter a workaround.
Posted by
Martin Richter
on 9/9/2005 at 2:21 AM
Simple define the reserved word for each include file to a different name!
#undef BOOMARK
#define BOOMARK MAPI_BOOKMARK
#include <mapidefs.h>
#undef BOOMARK
#define BOOMARK SQL_BOOKMARK
#include <sqltypes.h>
#undef
In your code, you have to use the specific BOOKMARK type you want.
All mapi BOOKMARKS must use MAPI_BOOKMARK, all code using the SQL BOOMARK must use SQL_BOOKMARK.
Drawback: If other header files use a specific BOOKMARK they must be includes directly after mapidefs or sqltypes.
Posted by
Marius Bancila
on 6/22/2011 at 8:00 AM
This is a workaround that works, using namespace:
#include <Windows.h>
namespace MAPI
{
#include <MAPIDefS.h>
}
namespace SQL
{
#include <sqlext.h>
}
using namespace MAPI;
using namespace SQL;
int _tmain(int argc, _TCHAR* argv[])
{
SQL::BOOKMARK b;
return 0;
}
© 2012 Microsoft Corporation. All rights reserved.
Microsoft Connect Terms of Use
|
Trademarks
|
Privacy Statement
Microsoft