Question

I'm using the RDP ActiveX control in a web page to open remote desktop connections. Here is the code I using but it doesn't work, it gets stuck when calling the GetErrorDescription method:

<script language="vbscript">

    sub MsRdpClient_OnDisconnected(disconnectCode)

      dim error_message

      extendedDiscReason = MsRdpClient.ExtendedDisconnectReason

      MsRdpClient.GetErrorDescription disconnectCode, extendedDiscReason, error_message

      MsgBox error_message, 0, "Error"

    end sub

</script>

Thanks, Rafael

Was it helpful?

Solution 2

I found the answer at the TechNet Forums.

<script language="vbscript">

    sub MsRdpClient_OnDisconnected(disconnectCode)

      dim error_message

      extendedDiscReason = MsRdpClient.ExtendedDisconnectReason

      error_message = MsRdpClient.GetErrorDescription(disconnectCode, extendedDiscReason)

      MsgBox error_message, 0, "Error"

    end sub

</script>

Now I only need to know how to write the MsRdpClient events handlers in javascript instead of vbscript.

OTHER TIPS

I think you're hitting this [1] limitation. VBScript works exclusively with Variants, so it can't accept out parameters of more specific types.

Since you can't change the RDP ActiveX control, there is little you can do besides writing a thin C++ wrapper. But that comes with other headaches...

[1] http://support.microsoft.com/kb/197957

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top