I'm in VS 2008 VB.NET
I have a form with the RDP control on the form. In the Form1_Load event I set the parameters to connect:
rdp6.Server = "10.1.1.1"
rdp6.UserName = "abc"
rdp6.AdvancedSettings2.ClearTextPassword = "def"
rdp6.Connect()
It connects and I see the remote system. Now on the remote I logoff. Fine.
What I would like to do is detect the disconnect and close down the executing program. So I use one of the RDP events:
Private Sub rdp6_OnDisconnected(ByVal sender As Object, ByVal e As AxMSTSCLib.IMsTscAxEvents_OnDisconnectedEvent) Handles rdp6.OnDisconnected
Me.Close()
End Sub
It appears to want to do the job but I get an error:
AccessViolationException was unhandled
Attempt to read or write protected memory. This is often an indicate that other memory is corrupt.
OK, sure. I got no idea.
I have a form with the RDP control on the form. In the Form1_Load event I set the parameters to connect:
rdp6.Server = "10.1.1.1"
rdp6.UserName = "abc"
rdp6.AdvancedSettings2.ClearTextPassword = "def"
rdp6.Connect()
It connects and I see the remote system. Now on the remote I logoff. Fine.
What I would like to do is detect the disconnect and close down the executing program. So I use one of the RDP events:
Private Sub rdp6_OnDisconnected(ByVal sender As Object, ByVal e As AxMSTSCLib.IMsTscAxEvents_OnDisconnectedEvent) Handles rdp6.OnDisconnected
Me.Close()
End Sub
It appears to want to do the job but I get an error:
AccessViolationException was unhandled
Attempt to read or write protected memory. This is often an indicate that other memory is corrupt.
OK, sure. I got no idea.