Cannot load Universal Dynamic Virtual Channel with ActiveX Control in C# Windows Form

0

I use Universal Dynamic Virtual Channel (UDVC): https://github.com/earthquake/UniversalDVC

After setting up everything of UDVC correctly, the MSTSC Remote Desktop Connection of Windows can load the UDVC-Plugin.dll successfully after connecting to the machine.

I create an C# Windows Form application with ActiveX Control AxMsRdpClient9NotSafeForScripting to remote a Windows Server 2016 machine. The problem is cannot load the virtual channel plugin with this code:

rdpClient.AdvancedSettings9.PluginDlls = strPluginName;

Reference link: https://docs.microsoft.com/en-us/windows/win32/termserv/using-the-remote-desktop-activex-control-with-virtual-channels

Please check the code below:

using AxMSTSCLib;
using System;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace RemoteControlClient
{
    public class RemoteDesktopApi
    {
        public void ConnectToComputer(string strMachineName, string strUsername, string strPassword)
        {
            try
            {
                var form = new RemoteControlClientForm();
                var rdpClient = new AxMsRdpClient9NotSafeForScripting();
                form.Controls.Add(rdpClient);
                form.Show();

                rdpClient.DesktopWidth = SystemInformation.VirtualScreen.Width;
                rdpClient.DesktopHeight = SystemInformation.VirtualScreen.Height;
                rdpClient.FullScreen = true;

                rdpClient.AdvancedSettings9.PluginDlls = strPluginName;
                //Plugin name could be "UDVC-Plugin.dll" or "{3C8458A3-2EBE-4840-BB07-3BA5BF810588}"
                rdpClient.Server = strMachineName;
                rdpClient.UserName = strUsername;
                rdpClient.AdvancedSettings8.ClearTextPassword = strPassword;
                rdpClient.AdvancedSettings3.ConnectToServerConsole = true;
                rdpClient.AdvancedSettings8.ConnectToAdministerServer = true;
                rdpClient.AdvancedSettings9.AuthenticationLevel = 2;
                rdpClient.AdvancedSettings8.EnableAutoReconnect = true;
                rdpClient.AdvancedSettings8.RedirectDrives = true;
                rdpClient.AdvancedSettings8.GrabFocusOnConnect = true;
                rdpClient.AdvancedSettings8.DisplayConnectionBar = true;
                rdpClient.AdvancedSettings8.EnableWindowsKey = 1;
                rdpClient.AdvancedSettings8.DisableCtrlAltDel = 1;
                rdpClient.AdvancedSettings8.allowBackgroundInput = 1;
                rdpClient.AdvancedSettings8.AcceleratorPassthrough = 1;
                rdpClient.AdvancedSettings8.BitmapPeristence = 1;
                rdpClient.AdvancedSettings8.Compress = 1;
                rdpClient.AdvancedSettings8.DoubleClickDetect = 1;
                rdpClient.AdvancedSettings7.EnableCredSspSupport = true;
                rdpClient.AdvancedSettings2.PerformanceFlags |= 0x00000080; //TS_PERF_ENABLE_FONT_SMOOTHING;
                rdpClient.Connect();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error");
            }
        }
    }
}

I don't know if I miss some code before calling this syntax. Do I need to create or set a virtual channel in code?

c#
activex
remote-desktop
virtual-channel
asked on Stack Overflow Sep 6, 2020 by Mike Tri

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0