Click here to Skip to main content
15,908,776 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Memory leak issue Pin
knoxplusplus23-May-06 8:03
knoxplusplus23-May-06 8:03 
QuestionDocument Types Pin
BlitzPackage18-May-06 7:46
BlitzPackage18-May-06 7:46 
AnswerRe: Document Types Pin
David Crow18-May-06 9:18
David Crow18-May-06 9:18 
GeneralRe: Document Types Pin
BlitzPackage18-May-06 10:07
BlitzPackage18-May-06 10:07 
Questionstdafx Pin
big_denny_20018-May-06 6:59
big_denny_20018-May-06 6:59 
AnswerRe: stdafx Pin
Michael Dunn18-May-06 7:36
sitebuilderMichael Dunn18-May-06 7:36 
AnswerRe: stdafx Pin
knoxplusplus23-May-06 8:05
knoxplusplus23-May-06 8:05 
QuestionMMC-Adding an Item to the context menu of the Results Pane Pin
Stevemc7518-May-06 5:46
Stevemc7518-May-06 5:46 
I'm trying to add a task to the context menu of the Results Pane but can not seem to do this atall!!
I have added a task to the node in the scope pane but when using the same code to add to the results pane it compiles but doesn't do anything. The results pane displays entries that are read into a vector from reading files from a particular directory.

Code I have used is same as below - help!!! Confused | :confused:

//This is taken from an platform sdk sample and works on the node but not the results
//add item adds the item to the context menu and the menu command deals with the
//resulting command.
HRESULT CRocket::OnAddMenuItems(IContextMenuCallback *pContextMenuCallback, long *pInsertionsAllowed)
{
HRESULT hr = S_OK;
CONTEXTMENUITEM menuItemsTask[] =
{
{
L"Start vehicle", L"Start the space vehicle",
IDM_START_SPACE, CCM_INSERTIONPOINTID_PRIMARY_TASK, 0, CCM_SPECIAL_DEFAULT_ITEM
},
{
L"Pause vehicle", L"Pause the space vehicle",
IDM_PAUSE_SPACE, CCM_INSERTIONPOINTID_PRIMARY_TASK, 0, 0
},
{
L"Stop vehicle", L"Stop the space vehicle",
IDM_STOP_SPACE, CCM_INSERTIONPOINTID_PRIMARY_TASK, 0, 0
},
{ NULL, NULL, 0, 0, 0 }
};

// Loop through and add each of the menu items
if (*pInsertionsAllowed & CCM_INSERTIONALLOWED_TASK)
{
for (LPCONTEXTMENUITEM m = menuItemsTask; m->strName; m++)
{
hr = pContextMenuCallback->AddItem(m);

if (FAILED(hr))
break;
}
}

return hr;
}

HRESULT CRocket::OnMenuCommand(IConsole *pConsole, long lCommandID)
{
const size_t cchBuffer = 128;
_TCHAR szVehicle[cchBuffer];

// StringCchPrintf and StringCchCopy always null-terminate the destination string.
// However the string may be a truncation of the ideal result (indicated by return value other than S_OK).

switch (lCommandID) {
case IDM_START_SPACE:
iStatus = RUNNING;
break;

case IDM_PAUSE_SPACE:
iStatus = PAUSED;
break;

case IDM_STOP_SPACE:
iStatus = STOPPED;
break;
}

StringCchPrintf(szVehicle, cchBuffer, _T("%s has been %s"), szName,
(long)iStatus == RUNNING ? _T("started") :
(long)iStatus == PAUSED ? _T("paused") :
(long)iStatus == STOPPED ? _T("stopped") : _T("!!!unknown command!!!"));

MAKE_WIDEPTR_FROMTSTR(ptrname, szVehicle);
int ret = 0;
pConsole->MessageBox(ptrname,
L"Vehicle command", MB_OK | MB_ICONINFORMATION, &ret);

return S_OK;
}

Steve
QuestionCRecordset Timing Problem Pin
e-DJ18-May-06 5:16
e-DJ18-May-06 5:16 
QuestionCRecordset and CTime Problem Pin
e-DJ18-May-06 5:09
e-DJ18-May-06 5:09 
QuestionRe: CRecordset and CTime Problem Pin
David Crow18-May-06 5:54
David Crow18-May-06 5:54 
QuestionRe: CRecordset and CTime Problem Pin
e-DJ19-May-06 2:57
e-DJ19-May-06 2:57 
AnswerRe: CRecordset and CTime Problem Pin
David Crow19-May-06 3:03
David Crow19-May-06 3:03 
GeneralRe: CRecordset and CTime Problem Pin
e-DJ23-May-06 5:51
e-DJ23-May-06 5:51 
QuestionError not releasing memeory Pin
bujji_bec18-May-06 4:50
bujji_bec18-May-06 4:50 
AnswerRe: Error not releasing memeory Pin
NiceNaidu18-May-06 4:58
NiceNaidu18-May-06 4:58 
AnswerRe: Error not releasing memeory Pin
led mike18-May-06 4:59
led mike18-May-06 4:59 
GeneralRe: Error not releasing memeory Pin
Cedric Moonen18-May-06 5:07
Cedric Moonen18-May-06 5:07 
GeneralRe: Error not releasing memeory Pin
led mike18-May-06 5:46
led mike18-May-06 5:46 
GeneralRe: Error not releasing memeory Pin
Cedric Moonen18-May-06 20:25
Cedric Moonen18-May-06 20:25 
AnswerRe: Error not releasing memeory Pin
Cedric Moonen18-May-06 5:01
Cedric Moonen18-May-06 5:01 
GeneralRe: Error not releasing memeory Pin
Chris Losinger18-May-06 5:10
professionalChris Losinger18-May-06 5:10 
JokeRe: Error not releasing memeory Pin
Roger Stoltz18-May-06 6:17
Roger Stoltz18-May-06 6:17 
GeneralRe: Error not releasing memeory Pin
ThatsAlok18-May-06 19:03
ThatsAlok18-May-06 19:03 
GeneralRe: Error not releasing memeory Pin
led mike18-May-06 5:49
led mike18-May-06 5:49 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.