1新建一个空的工程命名为AoWrapperDemo
2 添加一个新项目,命名为AoWrapper
右键项目-》属性,添加ESRI.ArcGIS相关引用
将配置类型改为动态链接库
添加一个c++文件,命名为GeometryWrapper
由于该类功能简单,没必要添加头文件
using namespace System;
using namespace System::Diagnostics; using namespace ESRI::ArcGIS::Geometry; using namespace ESRI::ArcGIS::esriSystem; using namespace ESRI::ArcGIS; namespace AoWrapper {
}
~GeometryWrapper() { }
public ref class GeometryWrapper { public:
pAoInitialize->Initialize(esriLicenseProductCode::esriLicenseProductC
GeometryWrapper() {
ESRI::ArcGIS::RuntimeManager::Bind(ProductCode::Engine); IAoInitialize^ pAoInitialize=gcnew AoInitializeClass();
odeEngineGeoDB);
}
public: };
int line_test() { }
IPoint ^ ipPt1 =gcnew PointClass(); IPoint ^ ipPt2 =gcnew PointClass(); ipPt1->PutCoords(1, 2); ipPt2->PutCoords(2, 3);
ILine^ ipLine=gcnew LineClass(); Stopwatch^ watch=gcnew Stopwatch(); watch->Start();
for(long i=0;i<=10000000; i++) { }
watch->Stop();
Console::WriteLine(watch->ElapsedMilliseconds); return 0;
ipLine->PutCoords(ipPt1,ipPt2); //Console::WriteLine(i);
完成C++/CLI对ArcObjects的调用封装类库
3 添加一个新项目,命名为NAoHelper,利用本地c++直接操作AO
搜索“diyifanwen.net”或“第一范文网”即可找到本站免费阅读全部范文。收藏本站方便下次阅读,第一范文网,提供最新高中教育C++CLI调用ArcObjects 全文阅读和word下载服务。
相关推荐: