//==============================================================; // // This source code is only intended as a supplement to // existing Microsoft documentation. // // // // // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY // KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE // IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR // PURPOSE. // // Copyright (C) 1999 Microsoft Corporation. All Rights Reserved. // // // //==============================================================; #include "Land.h" const GUID CLandBasedVehicle::thisGuid = { 0x2974380e, 0x4c4b, 0x11d2, { 0x89, 0xd8, 0x0, 0x0, 0x21, 0x47, 0x31, 0x28 } }; //============================================================== // // CLandBasedVehicle implementation // // HRESULT CLandBasedVehicle::OnAddMenuItems(IContextMenuCallback *pContextMenuCallback, long *pInsertionsAllowed) { HRESULT hr = S_OK; CONTEXTMENUITEM menuItemsNew[] = { { L"Land based", L"Add a new land based vehicle", IDM_NEW_LAND, CCM_INSERTIONPOINTID_PRIMARY_NEW, 0, CCM_SPECIAL_DEFAULT_ITEM }, { NULL, NULL, 0, 0, 0 } }; // Loop through and add each of the menu items if (*pInsertionsAllowed & CCM_INSERTIONALLOWED_NEW) { for (LPCONTEXTMENUITEM m = menuItemsNew; m->strName; m++) { hr = pContextMenuCallback->AddItem(m); if (FAILED(hr)) break; } } return hr; } HRESULT CLandBasedVehicle::OnMenuCommand(IConsole *pConsole, long lCommandID) { switch (lCommandID) { case IDM_NEW_LAND: pConsole->MessageBox(L"This sample does not create a new item\nSee Complete sample for a demonstration", L"Menu Command", MB_OK|MB_ICONINFORMATION, NULL); break; } return S_OK; }