Click here to Skip to main content
15,910,121 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Boot Service Question Pin
Jeffrey Walton29-Jan-07 6:07
Jeffrey Walton29-Jan-07 6:07 
GeneralRe: Boot Service Question Pin
Jeffrey Walton30-Jan-07 7:50
Jeffrey Walton30-Jan-07 7:50 
QuestionDistribution Pin
Bram van Kampen28-Jan-07 16:43
Bram van Kampen28-Jan-07 16:43 
Questiontime counter Pin
jroxxxer28-Jan-07 12:46
jroxxxer28-Jan-07 12:46 
AnswerRe: time counter Pin
Christian Graus28-Jan-07 12:55
protectorChristian Graus28-Jan-07 12:55 
AnswerRe: time counter Pin
whatever@whatever.com28-Jan-07 22:05
whatever@whatever.com28-Jan-07 22:05 
QuestionNetwork Monitoring System [modified] Pin
moorthya28-Jan-07 11:18
moorthya28-Jan-07 11:18 
QuestionWMI in C++ Pin
kvd9928-Jan-07 9:20
kvd9928-Jan-07 9:20 
Hi,

I would really appriciate som help with a difficult task regarding WMI and C++.

I would like to call the Method GetOwner() from the Win32_Process Class after query on a process.

This is the equavilent Visual Basic code:
Public Function getownerwmi(ByVal pid As Long, ByRef wmiowner As String) As Long<br />
    Dim colProcessList<br />
    Dim objprocess<br />
    Set colProcessList = GetObject("Winmgmts:").ExecQuery("Select * from Win32_Process where processid = " & pid)<br />
    If IsObject(colProcessList) Then<br />
        For Each objprocess In colProcessList<br />
    <br />
            ret = objprocess.getowner(struser, strdomain)<br />
            wmiowner = struser<br />
            getownerwmi = 1<br />
        Next<br />
    End If<br />
    Set colProcessList = Nothing<br />
    Set objprocess = Nothing<br />
End Function


I have looked throught these articles but I cant figure out where to call the GetOwner method:

MS Article:
http://msdn2.microsoft.com/en-us/library/aa384833.aspx[^]
MS Article 2:
http://msdn2.microsoft.com/en-us/library/aa390421.aspx[^]

Article on Code project:
http://www.codeproject.com/system/UsingWMI.asp?df=100&forumid=185770&exp=0&select=1509450#xx1509450xx[^]


Any help would be really appriciated!
AnswerRe: WMI in C++ Pin
Hamid_RT28-Jan-07 19:33
Hamid_RT28-Jan-07 19:33 
GeneralRe: WMI in C++ Pin
kvd9929-Jan-07 6:32
kvd9929-Jan-07 6:32 
QuestionSteinberg SDK [modified] Pin
pgr_sapple28-Jan-07 6:40
pgr_sapple28-Jan-07 6:40 
Questionclient-server Pin
reyyy28-Jan-07 6:27
reyyy28-Jan-07 6:27 
AnswerRe: client-server Pin
reyyy29-Jan-07 4:56
reyyy29-Jan-07 4:56 
Questionwhy mouse hook processed 2 times? Pin
bengz28-Jan-07 6:22
bengz28-Jan-07 6:22 
AnswerRe: why mouse hook processed 2 times? Pin
Mark Salsbery28-Jan-07 7:06
Mark Salsbery28-Jan-07 7:06 
GeneralRe: why mouse hook processed 2 times? Pin
bengz28-Jan-07 7:22
bengz28-Jan-07 7:22 
QuestionRe: why mouse hook processed 2 times? Pin
Mark Salsbery28-Jan-07 7:27
Mark Salsbery28-Jan-07 7:27 
AnswerRe: why mouse hook processed 2 times? Pin
bengz28-Jan-07 7:43
bengz28-Jan-07 7:43 
GeneralRe: why mouse hook processed 2 times? Pin
Mark Salsbery28-Jan-07 7:57
Mark Salsbery28-Jan-07 7:57 
QuestionDisplay Message Pin
jon_fallon28-Jan-07 5:21
jon_fallon28-Jan-07 5:21 
AnswerRe: Display Message Pin
Eytukan28-Jan-07 5:30
Eytukan28-Jan-07 5:30 
GeneralRe: Display Message Pin
jon_fallon28-Jan-07 5:45
jon_fallon28-Jan-07 5:45 
QuestionRe: Display Message Pin
prasad_som28-Jan-07 5:32
prasad_som28-Jan-07 5:32 
AnswerRe: Display Message Pin
jon_fallon28-Jan-07 5:42
jon_fallon28-Jan-07 5:42 
GeneralRe: Display Message Pin
Mark Salsbery28-Jan-07 7:12
Mark Salsbery28-Jan-07 7:12 

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.