本文整理汇总了C++中IDebugClient::CreateClient方法的典型用法代码示例。如果您正苦于以下问题:C++ IDebugClient::CreateClient方法的具体用法?C++ IDebugClient::CreateClient怎么用?C++ IDebugClient::CreateClient使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IDebugClient
的用法示例。
在下文中一共展示了IDebugClient::CreateClient方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: command
/*
* Class: sun_jvm_hotspot_debugger_windbg_WindbgDebuggerLocal
* Method: consoleExecuteCommand0
* Signature: (Ljava/lang/String;)Ljava/lang/String;
*/
JNIEXPORT jstring JNICALL Java_sun_jvm_hotspot_debugger_windbg_WindbgDebuggerLocal_consoleExecuteCommand0
(JNIEnv *env, jobject obj, jstring cmd) {
jboolean isCopy = JNI_FALSE;
const char* buf = env->GetStringUTFChars(cmd, &isCopy);
CHECK_EXCEPTION_(0);
AutoJavaString command(env, cmd, buf);
IDebugClient* ptrIDebugClient = (IDebugClient*) env->GetLongField(obj, ptrIDebugClient_ID);
CHECK_EXCEPTION_(0);
IDebugClient* tmpClientPtr = 0;
if (ptrIDebugClient->CreateClient(&tmpClientPtr) != S_OK) {
THROW_NEW_DEBUGGER_EXCEPTION_("Windbg Error: CreateClient failed!", 0);
}
AutoCOMPtr<IDebugClient> tmpClient(tmpClientPtr);
IDebugControl* tmpControlPtr = 0;
if (tmpClient->QueryInterface(__uuidof(IDebugControl), (PVOID*) &tmpControlPtr) != S_OK) {
THROW_NEW_DEBUGGER_EXCEPTION_("Windbg Error: QueryInterface (IDebugControl) failed", 0);
}
AutoCOMPtr<IDebugControl> tmpControl(tmpControlPtr);
SAOutputCallbacks* saOutputCallbacks = (SAOutputCallbacks*) env->GetLongField(obj,
ptrIDebugOutputCallbacks_ID);
CHECK_EXCEPTION_(0);
saOutputCallbacks->clearBuffer();
if (tmpClient->SetOutputCallbacks(saOutputCallbacks) != S_OK) {
THROW_NEW_DEBUGGER_EXCEPTION_("Windbg Error: SetOutputCallbacks failed!", 0);
}
tmpControl->Execute(DEBUG_OUTPUT_VERBOSE, command, DEBUG_EXECUTE_DEFAULT);
const char* output = saOutputCallbacks->getBuffer();
if (output == 0) {
output = "";
}
jstring res = env->NewStringUTF(output);
saOutputCallbacks->clearBuffer();
return res;
}
示例2: OpenUiSecondThread
DWORD WINAPI OpenUiSecondThread(void* parameter)
{
OpenUiSecondThreadParameters* p = (OpenUiSecondThreadParameters*)parameter;
IDebugClient* Client = p->Client;
char* Args = p->Args;
CAutoComPtr<IDebugClient> client2;
CHECKCOM(Client->CreateClient(&client2));
wstringstream ss;
ss << Args;
clr.InitializeContext(client2);
HRESULT result = clr.OpenUI(ss.str().c_str());
delete[] p->Args;
delete p;
return result;
}