Hinweis
Für den Zugriff auf diese Seite ist eine Autorisierung erforderlich. Sie können versuchen, sich anzumelden oder das Verzeichnis zu wechseln.
Für den Zugriff auf diese Seite ist eine Autorisierung erforderlich. Sie können versuchen, das Verzeichnis zu wechseln.
Last week I talked about how to receive Virtual Server events from a VBScript - this week I am going to talk about doing this from a managed application. To do this you need to:
Setup the managed application appropriately to talk to the Virtual Server COM interfaces (details here: https://blogs.msdn.com/virtual_pc_guy/search.aspx?q=typer&p=1)
Declare your Virtual Server COM object 'WithEvents' as follows:
Private WithEvents virtualServer As VMVirtualServer = Nothing
instead of:
Private virtualServer As VMVirtualServer = Nothing
Create a subroutine to catch the event:
Public Sub virtualServer_EventLogged(ByVal logMessageID As Integer) Handles virtualServer.OnEventLogged
'Do something with the event
msgbox(CStr(logMessageID))End Sub
There - really quite simple.
Cheers,
Ben
Comments
- Anonymous
January 27, 2006
Hi, Ben,
Very nice series on Event detection and handling on VS.
We are trying to detect when a legacy(and unstable) application crash the virtual machine. Is such event a vmVirtualMachineEvent_TripleFault or a
vmVirtualMachineEvent_HeartbeatStopped?
What are the difference between these two events in terms of impact on host OS?
Ying - Anonymous
January 27, 2006
Hi Ying,
You should be looking at 'HeartbeatStopped' event - as that will fire whenever the virtual machine crashes. TripleFault is a specific kind of crash - and will still trigger a 'HeartbeatStopped' event.
Cheers,
Ben