Click here to Skip to main content
15,892,927 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: compiler Pin
2bee 4-Apr-06 10:35
2bee 4-Apr-06 10:35 
AnswerRe: compiler Pin
mahafza4-Apr-06 10:48
mahafza4-Apr-06 10:48 
AnswerRe: compiler Pin
Rudolf Jan5-Apr-06 0:24
Rudolf Jan5-Apr-06 0:24 
GeneralRe: compiler Pin
mahafza5-Apr-06 5:19
mahafza5-Apr-06 5:19 
Questionx64 Conversion project with "Application error" Pin
Burtraskkutaren4-Apr-06 7:56
Burtraskkutaren4-Apr-06 7:56 
QuestionMouse Problem (or may be drag one) Pin
Tarek Jabri4-Apr-06 6:44
Tarek Jabri4-Apr-06 6:44 
Questionsetup project Pin
Manu_814-Apr-06 6:37
Manu_814-Apr-06 6:37 
AnswerRe: setup project Pin
David Crow4-Apr-06 7:24
David Crow4-Apr-06 7:24 
Questionfloating CDialogBar remains on screen when clicking the close button Pin
freddylowski4-Apr-06 6:37
freddylowski4-Apr-06 6:37 
QuestionHow do I keep menu attributes that exist when the menu refreshes? Pin
jonesap54-Apr-06 6:10
jonesap54-Apr-06 6:10 
QuestionRe: How do I keep menu attributes that exist when the menu refreshes? Pin
David Crow4-Apr-06 7:27
David Crow4-Apr-06 7:27 
QuestionRe: How do I keep menu attributes that exist when the menu refreshes? Pin
jonesap54-Apr-06 7:30
jonesap54-Apr-06 7:30 
AnswerRe: How do I keep menu attributes that exist when the menu refreshes? Pin
Michael Dunn4-Apr-06 11:31
sitebuilderMichael Dunn4-Apr-06 11:31 
AnswerRe: How do I keep menu attributes that exist when the menu refreshes? Pin
jonesap54-Apr-06 12:21
jonesap54-Apr-06 12:21 
Questionkill COM calls in thread Pin
viperlogic4-Apr-06 5:47
viperlogic4-Apr-06 5:47 
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 

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.