Am unable to get the connection done for the remote desktop using WPF.
Following is the code:
private void EmbedRdp()
{
// Create a new instance of the ActiveX control
AxMsRdpClient6NotSafeForScripting rdpControl = new AxMsRdpClient6NotSafeForScripting();
rdpControl.CreateControl();
rdpControl.Server = "";
rdpControl.UserName = "";
rdpControl.AdvancedSettings2.ClearTextPassword = "";
rdpControl.AdvancedSettings7.EnableCredSspSupport = true;
rdpControl.ColorDepth = 16;
rdpControl.DesktopWidth = 1024;
rdpControl.DesktopHeight = 720;
rdpControl.Connect();
// Add the control to a WindowsFormsHost control
WindowsFormsHost host = new WindowsFormsHost();
host.Child = rdpControl;
RDPContainer.Children.Add(host);
}
The connection somehow is never getting through.
I tried subscribing to different events like OnConnected, OnFatalError, OnConnecting, and OnLogonError, None of these events are triggered.
Similar code works with WinForms though.
Not sure what am missing here.
Thanks in Advance.