ArcObjects runtime binding for VC++ developers

35 篇文章 1 订阅

Loading an ArcGIS runtime

Stand-alone ArcGIS applications must locate an appropriate ArcGIS product installation before any ArcObjects code (including license initialization) is called. You must decide what runtime is needed for the application. This must be done whether the license initialization is carried out using the LicenseControl or by using the AoInitialize class. The application programming interfaces (APIs) used to bind to the ArcGIS runtime are in IArcGISVersion in the ArcGISVersionLib namespace. To bind to the runtime, make a call to the LoadVersion method. See the following code example:
To bind to a runtime, import the ArcGISVerison library and use the VersionManager method on the IArcGISVersion interface.
[VCPP]
// Load the ArcGISVersion library.
// This code is commonly placed in the StdAfx.h header file.
#import "libid:6FCCEDE0-179D-4D12-B586-58C88D26CA78" raw_interfaces_only
  no_implementation

// The following code can be used to bind to ArcGIS Engine Runtime:
ArcGISVersionLib::IArcGISVersionPtr ipVer(__uuidof(ArcGISVersionLib
  ::VersionManager));
VARIANT_BOOL succeeded;
if (FAILED(ipVer->LoadVersion(ArcGISVersionLib::esriArcGISEngine, L "10.0",
  &succeeded)))
  return 0;
LoadVersion must be called after calling CoInitialize but before initializing a license.
IArcGISVersion contains the following methods, which can be used to find installed runtimes and the install locations of the runtimes:
  • GetActiveVersion—Returns the product code, version number, and path to the runtime.
  • GetVersions—Returns an enumeration of all the installed ArcGIS runtimes on the machine.
  • ProductNameFromCode—Returns a product name for the given product code.
  • LoadVersion—Binds to the specified ArcObjects runtime.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值