本文整理汇总了C++中CConsole::SetReplaceCompletionCallback方法的典型用法代码示例。如果您正苦于以下问题:C++ CConsole::SetReplaceCompletionCallback方法的具体用法?C++ CConsole::SetReplaceCompletionCallback怎么用?C++ CConsole::SetReplaceCompletionCallback使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CConsole
的用法示例。
在下文中一共展示了CConsole::SetReplaceCompletionCallback方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
//int _tmain(/*int argc, TCHAR* argv[], TCHAR* envp[]*/)
int main ()
{
int nRetCode = 0;
HRESULT hr;
CSettings *pSettings = NULL;
CPrompt *pPrompt = NULL;
CShellCommandsLinkedList CommandsList(Console);
CShellCommandExit ExitCommand;
CommandsList.AddCommand(&ExitCommand);
CShellCommandVersion VersionCommand;
CommandsList.AddCommand(&VersionCommand);
CShellCommandHelp HelpCommand(CommandsList);
CommandsList.AddCommand(&HelpCommand);
CShellCommandDir DirCommand(Tree);
CommandsList.AddCommand(&DirCommand);
CShellCommandChangeKey ChangeKeyCommand(Tree);
CommandsList.AddCommand(&ChangeKeyCommand);
CShellCommandValue ValueCommand(Tree);
CommandsList.AddCommand(&ValueCommand);
CShellCommandOwner OwnerCommand(Tree);
CommandsList.AddCommand(&OwnerCommand);
CShellCommandDACL DACLCommand(Tree);
CommandsList.AddCommand(&DACLCommand);
CShellCommandSACL SACLCommand(Tree);
CommandsList.AddCommand(&SACLCommand);
CShellCommandConnect ConnectCommand(Tree);
CommandsList.AddCommand(&ConnectCommand);
CShellCommandNewKey NewKeyCommand(Tree);
CommandsList.AddCommand(&NewKeyCommand);
CShellCommandDeleteKey DeleteKeyCommand(Tree);
CommandsList.AddCommand(&DeleteKeyCommand);
CShellCommandSetValue SetValueCommand(Tree);
CommandsList.AddCommand(&SetValueCommand);
CShellCommandDeleteValue DeleteValueCommand(Tree);
CommandsList.AddCommand(&DeleteValueCommand);
CArgumentParser Parser;
pSettings = new (std::nothrow) CSettings();
if (!pSettings)
{
_ftprintf(stderr,_T("Cannot initialize settings. Out of memory.\n"));
goto Abort;
}
hr = pSettings->Load(SETTINGS_REGISTRY_KEY);
if (FAILED(hr))
{
_ftprintf(stderr,_T("Cannot load settings. Error is 0x%X.\n"),(unsigned int)hr);
goto Abort;
}
pPrompt = new (std::nothrow) CPrompt(Tree,hr);
if (!pPrompt)
{
_ftprintf(stderr,_T("Cannot initialize prompt. Out of memory.\n"));
goto Abort;
}
if (FAILED(hr))
{
_ftprintf(stderr,_T("Cannot initialize prompt. Error is 0x%X.\n"),(unsigned int)hr);
goto Abort;
}
// input buffer size in chars
#define INPUT_BUFFER_SIZE 1024
//#define INPUT_BUFFER_SIZE 128
//#define INPUT_BUFFER_SIZE 10
TCHAR *pchCommand;
pchCommand = Console.Init(INPUT_BUFFER_SIZE,10);
if (pchCommand == NULL)
{
_ftprintf(stderr,_T("Cannot initialize console.\n"));
nRetCode = 1;
goto Exit;
}
Console.SetReplaceCompletionCallback(CompletionCallback);
//.........这里部分代码省略.........