Select to view content in your preferred language

IDocument defined in both esriframework.tlb and atlhandler.h when using VS2010 C++

3656
2
09-16-2013 04:35 PM
RobertBredlie
Emerging Contributor
I am attempting to port my project from VS 2008 to VS2010.  When I try to compile I get the following error.

2010\src\esri\capturearcinfo\debug\esriframework.tlh(297): error C2872: 'IDocument' : ambiguous symbol
1>          could be '....\src\esri\capturearcinfo\debug\esriframework.tlh(30) : IDocument'
1>          or       'c:\program files (x86)\microsoft visual studio 10.0\vc\atlmfc\include\atlhandler.h(155) : ATL::IDocument'

From what I have been able to tell from the web MS has defined IDocument in ATL AND included a "using namespace..." inside the ATL header in VS2010.

Any suggestions before I surrender and go back to VS2008??

Thanks!

Robert
0 Kudos
2 Replies
RichardWatson
Deactivated User
One solution is to rename ESRI IDocument when you import the typelibrary.  This type of problem is common.

http://msdn.microsoft.com/en-us/library/298h7faa.aspx
0 Kudos
RobertBredlie
Emerging Contributor
One solution is to rename ESRI IDocument when you import the typelibrary.  This type of problem is common.

http://msdn.microsoft.com/en-us/library/298h7faa.aspx



Hi Richard,

Yes. I  have used that workaround for several other symbols.  This one appears to be special.  If I rename using the following line the IDocument class is no longer defined.



#import "\\builder\baseline\Packages\ESRI\Arc10\COM\esriFramework.olb"   raw_interfaces_only raw_native_types no_namespace named_guids exclude("UINT_PTR") rename("IDocument", "esriDocument")



(beginning of missing symbol errors.)
1>c:\baseline 2010\src\esri\capturearcinfo\esriinterface.h(138): error C2146: syntax error : missing ';' before identifier 'ipDoc'
1>c:\baseline 2010\src\esri\capturearcinfo\esriinterface.h(138): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\baseline 2010\src\esri\capturearcinfo\esriinterface.h(138): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\baseline 2010\src\esri\capturearcinfo\esriinterface.h(138): warning C4183: 'ipDoc': missing return type; assumed to be a member function returning 'int'
0 Kudos