I'm using this code:
Private Function CreateProcesByGuid(ByVal guid As String) As Object
Return DirectCast(Activator.CreateInstance(Type.GetTypeFromCLSID(New Guid(guid))), Object)
End Function
To run COM process using its GUID. Now I need to get guid of active process. Is there any way to do that? I have try this:
Dim g As GuidAttribute = GuidAttribute.GetCustomAttribute(p.GetType().Assembly, GetType(GuidAttribute))
If Not g Is Nothing Then
MsgBox(g.Value)
End If
But it doesnt work :(
My code:
Dim p As Process
For Each p In ps
Try
Dim g As GuidAttribute = GuidAttribute.GetCustomAttribute(p.GetType().Assembly, GetType(GuidAttribute))
MsgBox(g.Value)
Catch
End Try
Next p
Is there other way to get GUID from active process? I need to check if some process is working and if it is then to check his GUID.