设置GlobeControl当前的工具

来源:互联网 发布:黑龙江消防网通知通告 编辑:程序博客网 时间:2024/05/16 04:04
[C#]
ICommand command = new ControlsGlobeZoomInOutToolClass();
command.OnCreate(axGlobeControl1.Object);
if (command.Enabled == true)
{
  axGlobeControl1.CurrentTool = (ITool) command;
}

[Visual Basic .NET]
Dim pCommand As ICommandpCommand = New ControlsGlobeZoomInOutToolClass
pCommand.OnCreate(axGlobeControl1.Object)
If pCommand.Enabled = True Then
  axGlobeControl1.CurrentTool = pCommand
End If

[C++ Qt]
ICommandPtr cmd(CLSID_ControlsGlobeZoomInOutTool);
IDispatchPtr disp;
m_aeIpGlobeCtr->get_Object(&disp);
cmd->OnCreate(disp);
VARIANT_BOOL bEnable;
HRESULT hr = cmd->get_Enabled(&bEnable);
if(bEnable)
{
    m_aeIpGlobeCtr->putref_CurrentTool(IToolPtr(cmd));
}