Click here to Skip to main content
15,886,518 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: kill COM calls in thread Pin
ThatsAlok4-Apr-06 6:46
ThatsAlok4-Apr-06 6:46 
GeneralRe: kill COM calls in thread Pin
viperlogic4-Apr-06 6:56
viperlogic4-Apr-06 6:56 
GeneralRe: kill COM calls in thread Pin
ThatsAlok4-Apr-06 7:05
ThatsAlok4-Apr-06 7:05 
GeneralRe: kill COM calls in thread Pin
viperlogic4-Apr-06 7:40
viperlogic4-Apr-06 7:40 
AnswerRe: kill COM calls in thread Pin
David Crow4-Apr-06 7:28
David Crow4-Apr-06 7:28 
GeneralRe: kill COM calls in thread Pin
viperlogic4-Apr-06 8:01
viperlogic4-Apr-06 8:01 
GeneralRe: kill COM calls in thread Pin
David Crow4-Apr-06 8:13
David Crow4-Apr-06 8:13 
GeneralRe: kill COM calls in thread Pin
viperlogic4-Apr-06 10:19
viperlogic4-Apr-06 10:19 
i think i have that working now.

A kind of related problem i have is with the code below. This is a part of the code the thread executes, if sucessful all is ok. this thread has a timeout of 3secs. A problem is that the ConnectServer call below takes 2minutes to complete if it cant connect. when this happens the below messagebox pops ups and then the program crashes. is it crashing because the code wants to "return" but there is nothing to return to as the thread has been already killed?? How can i modify it so that it wont crash. A message box doesnt have to be displayed either.

many thanks

<br />
	hres = pLoc_test->ConnectServer(<br />
		_bstr_t(L"\\\\"+strIP1+"\\root\\cimv2"),		// Object path of WMI namespace<br />
        NULL,												// User name. NULL = current user<br />
        NULL,												// User password. NULL = current<br />
        0,													// Locale. NULL indicates current<br />
        WBEM_FLAG_CONNECT_USE_MAX_WAIT,						// Security flags<br />
        0,													// Authority        <br />
        0,													// Context object <br />
        &pSvc_test												// pointer to IWbemServices proxy<br />
        );<br />
<br />
    <br />
    if (FAILED(hres))<br />
    {<br />
       	char error_msg[64];<br />
		sprintf(error_msg, "wmi_test: Could not connect. Error code = 0x%x", hres);<br />
		MessageBox(error_msg , "Error" , MB_ICONERROR | MB_OK);<br />
<br />
        pLoc_test->Release();     <br />
        return;    	<br />
    }<br />

QuestionRe: kill COM calls in thread Pin
David Crow4-Apr-06 10:37
David Crow4-Apr-06 10:37 
AnswerRe: kill COM calls in thread Pin
viperlogic4-Apr-06 10:41
viperlogic4-Apr-06 10:41 
GeneralRe: kill COM calls in thread Pin
David Crow4-Apr-06 11:02
David Crow4-Apr-06 11:02 
QuestionTreeView_CreateDragImage Pin
Luther Baker4-Apr-06 5:01
Luther Baker4-Apr-06 5:01 
Questionhackers delight, how to parse all compbinations Pin
9ine4-Apr-06 4:55
9ine4-Apr-06 4:55 
QuestionRe: hackers delight, how to parse all compbinations Pin
David Crow4-Apr-06 5:01
David Crow4-Apr-06 5:01 
AnswerRe: hackers delight, how to parse all compbinations Pin
9ine4-Apr-06 5:05
9ine4-Apr-06 5:05 
AnswerRe: hackers delight, how to parse all compbinations Pin
toxcct4-Apr-06 5:11
toxcct4-Apr-06 5:11 
GeneralRe: hackers delight, how to parse all compbinations Pin
9ine4-Apr-06 5:36
9ine4-Apr-06 5:36 
GeneralRe: hackers delight, how to parse all compbinations Pin
9ine4-Apr-06 6:25
9ine4-Apr-06 6:25 
QuestionRe: hackers delight, how to parse all compbinations Pin
David Crow4-Apr-06 7:31
David Crow4-Apr-06 7:31 
AnswerRe: hackers delight, how to parse all compbinations Pin
9ine4-Apr-06 23:05
9ine4-Apr-06 23:05 
GeneralRe: hackers delight, how to parse all compbinations Pin
David Crow5-Apr-06 4:09
David Crow5-Apr-06 4:09 
QuestionCListCtrl Pin
Anthony98874-Apr-06 4:52
Anthony98874-Apr-06 4:52 
AnswerRe: CListCtrl Pin
David Crow4-Apr-06 4:59
David Crow4-Apr-06 4:59 
AnswerRe: CListCtrl Pin
Laxman Auti4-Apr-06 18:36
Laxman Auti4-Apr-06 18:36 
QuestionWhere do u declare m_pSet? Pin
swapna_signsin4-Apr-06 4:48
swapna_signsin4-Apr-06 4:48 

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.