Develop a RDP client in QT
-
Hi all,
I need to develop a QT/C++ application from which I could connect to another PC over RDP. I have been searching and I found that if I use QAxWidget it allows me to select the Active X control type and the Microsoft RDP COM Object is eligible. However, I am quite new in QT, and I have a few questions. Up to now, I tried to set the IP, the user and try to connect by the following code but, nothing really has happened (no errors, no debugging comments but it does nothing):
#include "mainwindow.h" #include "ui_mainwindow.h" MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) , ui(new Ui::MainWindow) { ui->setupUi(this); ui->RDP_Viewer->setControl(QString::fromUtf8("{301B94BA-5D25-4A12-BFFE-3B6E7A616585}")); ui->RDP_Viewer->setProperty("Server", "XXX.XXX.XXX.XXX"); ui->RDP_Viewer->setProperty("UserName", "User"); } MainWindow::~MainWindow() { delete ui; } void MainWindow::on_pushButton_clicked() { ui->RDP_Viewer->dynamicCall("Connect()"); }
So, what I am doing wrong?
There is something missing?If someone could help me I would appreciate.
Thanks in advanced,
-
@P25B
I don't think we know the details of how the MS RDP ActiveX control works. For example, maybe your usage falls foul of https://docs.microsoft.com/en-us/windows/win32/termserv/providing-for-rdp-client-security. There seems to be an awful lot to read through starting from https://docs.microsoft.com/en-us/windows/win32/termserv/remote-desktop-activex-control plus all related sections. I could not spot simple example code of what they said is required to set up a connection successfully. Where did you get your code from for your simple way of setting up to call thisRDP_Viewer->dynamicCall("Connect()");
? And if that does nothing/fails, are there not calls to find out what happened or test for/display any error?