Namespace Problem ... I Think

K

Kris

Hi All,



I am having a problem compiling a C++ project that I am working on and I'm
hoping that one of you C++ gurus out there can provide me with some
guidance.



I have tried a number of things to correct the problem but have had no
success so far. I'm pretty sure that the problem is related to the fact that
two of the header files in the project are trying to include the same dll
file (msado15.dll).



I have provided the details for the error and the relevant code snippets
below. If anyone out there can provide some assistance, it would be greatly
appreciated.






The Error

===================

error C2871: 'ADOCG' : a namespace with this name does not exist



ADODatabase.h

===================

#import "C:\Program Files\Common Files\System\ADO\msado15.dll" \

rename("EOF", "EndOfFile")

#import "C:\Program Files\Common Files\System\ado\MSJRO.DLL" \

no_namespace

using namespace ADODB;




myCStudyRecordSet.h

===================

#import "C:\Program Files\Common Files\System\ADO\msado15.dll" \

rename_namespace("ADOCG") rename("EOF", "EndOfFile")

using namespace ADOCG;



Order of The Includes

===================

#include "ADODatabase.h"

#include "myCStudyRecordSet.h"





Thanks In Advance,

Kris
 
J

John Harrison

Kris said:
Hi All,



I am having a problem compiling a C++ project that I am working on and I'm
hoping that one of you C++ gurus out there can provide me with some
guidance.



I have tried a number of things to correct the problem but have had no
success so far. I'm pretty sure that the problem is related to the fact that
two of the header files in the project are trying to include the same dll
file (msado15.dll).

#import is not standard C++. Standard C++ has no way to include .dll files.
This group deals with standard C++ only.

Try again on a Windows programming group, e.g.
or one of the many groups on
Microsoft's news server news.microsoft.com

John
 
B

Bill Seurer

Kris said:
#import "C:\Program Files\Common Files\System\ADO\msado15.dll" \

rename("EOF", "EndOfFile")

#import "C:\Program Files\Common Files\System\ado\MSJRO.DLL" \

no_namespace

using namespace ADODB;

Other than the "using" line the above is not standard C++. You should
probably check the documentation that came with whatever tools you are
using.
 
K

Kris

#import is not standard C++. Standard C++ has no way to include .dll files.
This group deals with standard C++ only.

Try again on a Windows programming group, e.g.
or one of the many groups on
Microsoft's news server news.microsoft.com

John


Will do ... sorry, I didn't realize that #import wasn't standard c++.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,776
Messages
2,569,603
Members
45,200
Latest member
LaraHunley

Latest Threads

Top