[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));
}
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));
}
C#、Visual Basic.NET 和 C++Qt 中的命令工具交互实例
本文介绍了在C#、Visual Basic.NET 和 C++Qt环境中通过ICommand接口实现命令工具交互的过程,包括创建、启用和应用工具的方法。
1505

被折叠的 条评论
为什么被折叠?



