phoenix_13


Hello,

actually i try to create a native c++ desktop-application that will have to access a SQL CE 3.1 db-file over OLE DB. For that purpose i want to use the same self written wrapper class(for the OLE DB stuff) that i use for a native WM2003 application that creates the db files to be accessed on the desktop application.
The WM2003 application including my wrapper class compiles fine with eVC++ 4.0.
But now with VS 2005 including the same class i got this compile error: "Redefinition of class IRowsetBookmark". I have to add that i used the application wizard to generate a mfc sdi application with database support(ODBC is used in this app, too).
I figured out that in the following 2 inlcuded files IRowsetBookmark is defined:
1)The manually included "ssceoledb30.h" in my wrapper class.
2)The probably from the application wizard included "oledb.h" (in "\Microsoft Visual Studio 8\VC\PlatformSDK\Include")

My workaround for the moment is to comment the class definition in the file "ssceoledb30.h" out because i don't use this OLE DB interface in my wrapper class. But i don't think that this is the way that microsoft supposed to go.

Does anybody had this problem and solved it other way than simply comment one of the class definition out

I would appreciate it when someone out there knows the answer and could tell me.

Kind regards,
Andre




Re: Compile Error: Redefinition of IRowsetBookmark (VS 2005)

João Paulo Figueira


The ssceoledb30.h file contains both the standard oledb.h and the SQL Compact Edition-specific definitions. Theoretically, you should be able to use just this file. In my products, I'm using a sqlmobile.h file that was published by Microsoft but does not seem to be available now. This file contains only the SQL Compact Edition stuff and was designed to be used with the oledb.h file.







Re: Compile Error: Redefinition of IRowsetBookmark (VS 2005)

phoenix_13

Thanks for your answer.
The problem will be to find the place where the oledb.h is included. I've done a search over the complete project and found no include line for that header. So it is inlcluded within some of the other header files.
It's not my intention to modify any system header files. So i would also prefer a header you mention that only contains the SQL Compact Edition-specific definitions.

Maybe someone knows where this header file from microsoft is still available or knows another way to get this working without the need of modifying standard header files.

Kind regards,
Andre






Re: Compile Error: Redefinition of IRowsetBookmark (VS 2005)

João Paulo Figueira

I am sorry but the sqlmobile.h file was never released by Microsoft. Would you believe that I built this file myself from ssceoledb30.h, wrote an article about this and completely forgot about it

I'm getting old...






Re: Compile Error: Redefinition of IRowsetBookmark (VS 2005)

phoenix_13

Joao Paulo Figueira wrote:

I am sorry but the sqlmobile.h file was never released by Microsoft. Would you believe that I built this file myself from ssceoledb30.h, wrote an article about this and completely forgot about it

I'm getting old...



Never mind!

With your help i got a solution without the need to modify the standard headers. That's the main thing. Now with dependent include of ssceoledb30.h or sqlmobile my wrapper class can be used both for native mobile and native desktop developement without the need of adaption.
In difference to your article i have additionally had to comment the complete class IRowsetBookmark out as stated in the early post, not just the GUID definition of IID_IRowsetBookmark.

Kind regards,
Andre