Ejemplo n.º 1
0
HRESULT CFolderViewCommandEnumerator::_CreateCommandFromCommandItem(FVCOMMANDITEM *pfvci, IExplorerCommand **ppExplorerCommand)
{
    CFolderViewCommand *pCommand = new (std::nothrow) CFolderViewCommand(pfvci);
    HRESULT hr = pCommand ? S_OK : E_OUTOFMEMORY;
    if (SUCCEEDED(hr))
    {
        hr = pCommand->QueryInterface(IID_PPV_ARGS(ppExplorerCommand));
        pCommand->Release();
    }
    return hr;
}
Ejemplo n.º 2
0
HRESULT CFolderViewCommandEnumerator::_CreateCommandFromCommandItem(FVCOMMANDITEM *pfvci, IExplorerCommand **ppExplorerCommand)
{
	CFolderViewCommand *pCommand;
	switch (pfvci->commandId)
	{
		case NEW_FOLDER_COM:
		{
			pCommand = new (std::nothrow) NewFolderCommand(pfvci, m_pFolderView);
			break;
		}
		case DISPLAY_COM:
		{
			pCommand = new (std::nothrow) DisplayCommand(pfvci);
			break;
		}
	}
    HRESULT hr = pCommand ? S_OK : E_OUTOFMEMORY;
    if (SUCCEEDED(hr))
    {
        hr = pCommand->QueryInterface(IID_PPV_ARGS(ppExplorerCommand));
        pCommand->Release();
    }
    return hr;
}