Click here to Skip to main content
15,921,716 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Answerbut you are you shouting ???? Pin
Anonymous29-Apr-05 20:23
Anonymous29-Apr-05 20:23 
GeneralRe: but you are you shouting ???? Pin
ThatsAlok29-Apr-05 21:22
ThatsAlok29-Apr-05 21:22 
AnswerRe: HOW TO DETACT MULTIPLE VGA CARDS IN VC++ Pin
David Crow30-Apr-05 6:33
David Crow30-Apr-05 6:33 
GeneralProblem with flipping DDraw surfaces Pin
Kieroshark29-Apr-05 17:21
Kieroshark29-Apr-05 17:21 
Generaldesign membership function Pin
Anonymous29-Apr-05 17:21
Anonymous29-Apr-05 17:21 
GeneralBinary Waveform Pin
gremouster29-Apr-05 16:41
gremouster29-Apr-05 16:41 
QuestionHow to display bitmap bit data from memory? Pin
mikec++29-Apr-05 13:06
mikec++29-Apr-05 13:06 
AnswerRe: How to display bitmap bit data from memory? Pin
Shog929-Apr-05 14:25
sitebuilderShog929-Apr-05 14:25 
GeneralRe: How to display bitmap bit data from memory? Pin
mikec++29-Apr-05 14:56
mikec++29-Apr-05 14:56 
GeneralRe: How to display bitmap bit data from memory? Pin
mikec++29-Apr-05 16:00
mikec++29-Apr-05 16:00 
Generalnon-member function threading Pin
outoolcoe29-Apr-05 12:56
outoolcoe29-Apr-05 12:56 
Generalpipes of CreateProcess() Pin
includeh1029-Apr-05 11:20
includeh1029-Apr-05 11:20 
GeneralParsing XML file Pin
Reveur129-Apr-05 10:28
Reveur129-Apr-05 10:28 
GeneralDisplay a disabled 24-bit image Pin
eddya29-Apr-05 9:44
eddya29-Apr-05 9:44 
GeneralRe: Display a disabled 24-bit image Pin
bmzhao29-Apr-05 14:19
bmzhao29-Apr-05 14:19 
QuestionWhy make a function 'static'? Pin
Chris Meech29-Apr-05 9:35
Chris Meech29-Apr-05 9:35 
AnswerRe: Why make a function 'static'? Pin
David Crow29-Apr-05 9:43
David Crow29-Apr-05 9:43 
GeneralRe: Why make a function 'static'? Pin
Chris Meech2-May-05 2:11
Chris Meech2-May-05 2:11 
AnswerRe: Why make a function 'static'? Pin
BambooMoon29-Apr-05 9:50
BambooMoon29-Apr-05 9:50 
AnswerRe: Why make a function 'static'? Pin
Blake Miller29-Apr-05 10:44
Blake Miller29-Apr-05 10:44 
GeneralRe: Why make a function 'static'? Pin
Chris Meech2-May-05 2:16
Chris Meech2-May-05 2:16 
GeneralWMI Pin
Alex_Y29-Apr-05 9:01
Alex_Y29-Apr-05 9:01 
GeneralRe: WMI Pin
Alexander M.,29-Apr-05 9:04
Alexander M.,29-Apr-05 9:04 
GeneralRe: WMI Pin
Alex_Y2-May-05 2:12
Alex_Y2-May-05 2:12 
GeneralRe: WMI Pin
David Crow29-Apr-05 9:35
David Crow29-Apr-05 9:35 
Something like:

HRESULT                 hr;
_variant_t              v;
ULONG                   ulReturned;
DWORD                   dwAuthLevel;
IWbemLocator            *pLocator;
IWbemServices           *pService = NULL;
IEnumWbemClassObject    *pEnum = NULL;
IWbemClassObject        *pClass;
 
hr = CoCreateInstance(CLSID_WbemLocator, 0, CLSCTX_INPROC_SERVER, IID_IWbemLocator, (LPVOID *) &pLocator);
if (S_OK == hr)
{
    hr = pLocator->ConnectServer(_bstr_t(L"root\\cimv2"), NULL, NULL, NULL, NULL, 0, NULL, &pService);
    if (WBEM_S_NO_ERROR == hr)
    {
        hr = CoQueryProxyBlanket(pService, NULL, NULL, NULL, &dwAuthLevel, NULL, NULL, NULL);
        hr = CoSetProxyBlanket(pService, RPC_C_AUTHN_DEFAULT, RPC_C_AUTHZ_NONE, NULL, dwAuthLevel, 
                 RPC_C_IMP_LEVEL_IMPERSONATE, NULL, EOAC_NONE);
 
        hr = pService->CreateInstanceEnum(_bstr_t("Win32_PerfFormattedData_PerfProc_Thread"), 
                 WBEM_FLAG_RETURN_IMMEDIATELY | WBEM_FLAG_FORWARD_ONLY, NULL, &pEnum);
        if (WBEM_S_NO_ERROR == hr)
        {
            do
            {
                hr = pEnum->Next(WBEM_INFINITE, 1, &pClass, &ulReturned);
                if (WBEM_S_NO_ERROR == hr)
                {
                    hr = pClass->Get(L"Caption", 0, &v, NULL, NULL);
                    if (VT_NULL != v.vt)
                        TRACE("Caption = %s\n", V_BSTR(&v));
                }
            } while (WBEM_S_NO_ERROR == hr);
            
            pEnum->Release();
        }
 
        pService->Release();
    }
 
    pLocator->Release();
}



"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown


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.