How to disable menu in MicroStation CE Update15 using XCommands?

Attached sample code snippet. I am getting command name using Xcommand.

In that, there is SetIsEnabled(bool Enabled) API. 

How to use this. I am facing compilation error in Visual Studio 2017.

void DisableMenu()
{
	 IXCommandCP cmd_ptr = XCommandManager::GetManager().FindXCommandByIconName(L"About");
	 IXCommand* xcmd = (IXCommand*)cmd_ptr;
	 xcmd->SetIsEnabled(FALSE);
}

Error:

error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __cdecl Bentley::ECN::IUICommand::SetIsEnabled(bool)" (__imp_?SetIsEnabled@IUICommand@ECN@Bentley@@QEAAX_N@Z) referenced in function "void __cdecl DisableMenu(void)" (?DisableMenu@@YAXXZ).

Regards,

Rajesh

Parents Reply Children