Hello All,
I am having vb 6.0 ActiveX dll contains one method
In C#.Net console application i added this vb 6.0 dll and crated the object to that and then try to access GetHandleCount( ) method.
Please find my next post for question...
I am having vb 6.0 ActiveX dll contains one method
Code:
Public Function GetHandleCount() As String
Set objRefresher = CreateObject("WbemScripting.SWbemRefresher")
Set objServicesCimv2 = GetObject("winmgmts:\\" _
& "." & "\root\cimv2")
Set objRefreshableItem = objRefresher.AddEnum(objServicesCimv2, "Win32_PerfFormattedData_PerfProc_Process")
objRefresher.Refresh
strf = Format(Now, "dd-MMM-yyyy HH:nn:ss") & "." & Right(Format(Timer, "#0.000"), 3)
For I = 1 To 2
objRefresher.Refresh
For Each Process In objRefreshableItem.ObjectSet
If Process.Name = "_Total" Then
strf = strf & " " & Process.HandleCount
End If
Next
Next
GetHandleCount = strf
End Function
Code:
Project1.VBCls obj = new Project1.VBCls(); Console.WriteLine(obj.GetHandleCount());
Comment