Search code examples
delphicomactivex

Imported ActiveX Control in Delphi 10.2 CE Unavailable In Palette


I am using the community edition but am not aware of any limits in this regard.

I have imported mstscax.dll via Component |> Import Component... and selecting "ActiveX." The component does not show up in in the component palette and editing the the DFM directly to include a TMsRdpClient[digit] component results in form builder errors stating the component can not be found.

However it is possible to get a premade project (RDPWrap's RDPCheck) to build and run if those errors are "Cancelled" instead of "Ignored." It is also necessary to resolve the error mentioned here.

In a project I have created myself I am able to add the generated file MSTSCLib_TLB to the uses clause and to add a variable of type TMsRdpClient7 to a form. In the FormCreate function (for example) I am able to call TMsRdpClient7.Create(Self) and then access the properties of the object. If I set enough properties (see below) I get the authorization popup and see the login screen after calling TMsRdpClient7.Connect.

  with RDP do
  begin
    Left := 0;
    Top := 0;
    Width := Self.Width;
    Height := Self.Height;
    Parent := Self;
    Visible := True;

    DisconnectedText := 'Disconnected.';
    UserName := '';
    Server := '127.0.0.2';
  end;

Solution

  • Importing MSTScax.Dll works fine for me on Delphi 10.2.3 and results in 25 components being displayed on the ActiveX tab of the component palette, starting with the TMsTScaxNotSafeForScripting component.

    I could post the exact steps used but I'm wondering whether you are simply missing a step:

    After you've corrected the ConnectWithEndpoint Property type to OleVariant and compiled the package which contains your import unit MSTSCLib_TLB.Pas, let's call it RDP.Pkg, you need to go to the Project Manager, right-click on RDP.Bpl and click Install - then, it should show up on the ActiveX tab. Does that work for you?

    Btw, I'm starting Delphi in the ordinary way from its deskstop link on Win10 64-bit, not using special measures such 'Run as Administrator'.