B
Bill Struve
Need: Auto-logon to a terminal server, start a program, and, when the user
is quits the program, auto-logoff.
Problem: When msrdp.ocx is added to the Toolbox, attempting to draw the
control on the form gives the following "Microsoft Development Environment"
message:
"Compiler errors occured when generating a Windows Forms wrapper for ActiveX
control 'AxMSTSCLib'. Source code saved in '...AxInterop.MSTSCLib.cs'.
c
ocuments and Settings\struvew\Local
Settings\Temp\8rzmsoz_.0.cs(493,24):error CS0037: Cannot convert null to
'MSTSCLib.AutoReconnectContinueState' because it is a value type
c
ocuments and Settings\struvew\Local
Settings\Temp\8rzmsoz_.0.cs(1282,24):error CS0037: Cannot convert null to
'MSTSCLib.AutoReconnectContinueState' because it is a value type"
Note that I can find no files like "c
ocuments and Settings\struvew\Local
Settings\Temp\8rzmsoz" either before, during, or after the above error
message.
There is a similar message from either VC.NET or VB.NET, and the control
never appears on the form.
My workaround has been to use VB6, since the control can be drawn on a VB6
form with no problem. The following code is then used to satify the "Need"
above:
Private Sub Form_Load()
MsRdpClient.DesktopHeight = Screen.Height / Screen.TwipsPerPixelY
MsRdpClient.DesktopWidth = Screen.Width / Screen.TwipsPerPixelX
MsRdpClient.FullScreen = True
UsersForm.Height = (MsRdpClient.DesktopHeight + 30) *
Screen.TwipsPerPixelY
UsersForm.Width = MsRdpClient.DesktopWidth * Screen.TwipsPerPixelX
MsRdpClient.Height = MsRdpClient.DesktopHeight * Screen.TwipsPerPixelY
MsRdpClient.Width = MsRdpClient.DesktopWidth * Screen.TwipsPerPixelX
MsRdpClient.Server = "PC07405"
MsRdpClient.UserName = "******"
MsRdpClient.Domain = "PC07405"
MsRdpClient.AdvancedSettings2.ClearTextPassword = "******"
MsRdpClient.SecuredSettings.StartProgram = _
"D:\\Projects\\RMOnlineQuotes\\bin\\RunApplication.exe
RMAdministrativeTools.exe"
MsRdpClient.FullScreen = True
MsRdpClient.Connect
End Sub
Note that I changed the user name and password to ***** after pasting into
this.
After making the VB6 executable, I call it from C#. Although this works OK,
it is UGLYto have to write part in C# and part in VB6.
Is there anyting I can do so the auto-generated "Windows Forms wrapper" will
complete without error?
is quits the program, auto-logoff.
Problem: When msrdp.ocx is added to the Toolbox, attempting to draw the
control on the form gives the following "Microsoft Development Environment"
message:
"Compiler errors occured when generating a Windows Forms wrapper for ActiveX
control 'AxMSTSCLib'. Source code saved in '...AxInterop.MSTSCLib.cs'.
c

Settings\Temp\8rzmsoz_.0.cs(493,24):error CS0037: Cannot convert null to
'MSTSCLib.AutoReconnectContinueState' because it is a value type
c

Settings\Temp\8rzmsoz_.0.cs(1282,24):error CS0037: Cannot convert null to
'MSTSCLib.AutoReconnectContinueState' because it is a value type"
Note that I can find no files like "c

Settings\Temp\8rzmsoz" either before, during, or after the above error
message.
There is a similar message from either VC.NET or VB.NET, and the control
never appears on the form.
My workaround has been to use VB6, since the control can be drawn on a VB6
form with no problem. The following code is then used to satify the "Need"
above:
Private Sub Form_Load()
MsRdpClient.DesktopHeight = Screen.Height / Screen.TwipsPerPixelY
MsRdpClient.DesktopWidth = Screen.Width / Screen.TwipsPerPixelX
MsRdpClient.FullScreen = True
UsersForm.Height = (MsRdpClient.DesktopHeight + 30) *
Screen.TwipsPerPixelY
UsersForm.Width = MsRdpClient.DesktopWidth * Screen.TwipsPerPixelX
MsRdpClient.Height = MsRdpClient.DesktopHeight * Screen.TwipsPerPixelY
MsRdpClient.Width = MsRdpClient.DesktopWidth * Screen.TwipsPerPixelX
MsRdpClient.Server = "PC07405"
MsRdpClient.UserName = "******"
MsRdpClient.Domain = "PC07405"
MsRdpClient.AdvancedSettings2.ClearTextPassword = "******"
MsRdpClient.SecuredSettings.StartProgram = _
"D:\\Projects\\RMOnlineQuotes\\bin\\RunApplication.exe
RMAdministrativeTools.exe"
MsRdpClient.FullScreen = True
MsRdpClient.Connect
End Sub
Note that I changed the user name and password to ***** after pasting into
this.
After making the VB6 executable, I call it from C#. Although this works OK,
it is UGLYto have to write part in C# and part in VB6.
Is there anyting I can do so the auto-generated "Windows Forms wrapper" will
complete without error?