Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. MSTSCAX ActiveX Ctrl

MSTSCAX ActiveX Ctrl

Scheduled Pinned Locked Moved C / C++ / MFC
comquestion
11 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • 4 4apai

    Did anyone work with MSTSCAX ActiveX Ctrl? Regards.

    A Offline
    A Offline
    Antti Keskinen
    wrote on last edited by
    #2

    Yes, I have worked with MSTSCAX and it's interfaces. Now, what is your question/problem ? -Antti Keskinen ---------------------------------------------- The definition of impossible is strictly dependant on what we think is possible.

    4 1 Reply Last reply
    0
    • A Antti Keskinen

      Yes, I have worked with MSTSCAX and it's interfaces. Now, what is your question/problem ? -Antti Keskinen ---------------------------------------------- The definition of impossible is strictly dependant on what we think is possible.

      4 Offline
      4 Offline
      4apai
      wrote on last edited by
      #3

      i use IMsTscAx control to connect to the TS Server. setting valid server name and so on i finnaly call connect method. he return s_ok. but exploring other property's values i find that startconnected property is false - thats mean that control is not trying to connect. as a sequel connected property is false too. what do i do wrong?

      A 1 Reply Last reply
      0
      • 4 4apai

        i use IMsTscAx control to connect to the TS Server. setting valid server name and so on i finnaly call connect method. he return s_ok. but exploring other property's values i find that startconnected property is false - thats mean that control is not trying to connect. as a sequel connected property is false too. what do i do wrong?

        A Offline
        A Offline
        Antti Keskinen
        wrote on last edited by
        #4

        Unfortunately I cannot give my e-mail address, and I don't use ICQ. First, go and download and install the latest version of the Microsoft RDP Client ActiveX Control. You can find it here[^]. After the control is installed, browse to the directory where you installed it. You can find a 'default.htm' test page there. Open it up on your browser, and you'll get a test page. Use this test page to connect to the TS client like you normally would. If the connection fails, the problem resides in the TS Server, and not in your end. After installing, if you have Windows XP, you'll have two RDP Client controls. The one we just installed is called 'Microsoft RDP Client (redist)'. Use OLE/COM Viewer tool to browse through it's type library. When/If the connection was succesfull, the control is tested and you can use the it anywhere you need. I have created a small example application that connects to a server IP you provide it with, and displays the login screen. The code is commented heavily, and the interesting parts are in the Connect and Disconnect buttons click handlers. Works smoothly for me. The example application is not very usable, as the display area is very small. But it'll show you how it's done. Note that in order to disconnect my application from the TS Server, you must first click outside the RDP Desktop screen, then click on Disconnect button. You can download the source code and the example application from http://www.tpu.fi/~t1akeski/TSClient.zip. It is written with VC++ .Net 2003. As for the problem you described, then an answer is written to MSDN: The control connects asynchronously, so a return from a Connect call indicates only that the connection has been initiated successfully, not that it has been completed. You should respond to events on the IMsTscAxEvents interface to determine when the control has successfully connected (or has been disconnected). -Antti Keskinen ---------------------------------------------- The definition of impossible is strictly dependant on what we think is possible.

        4 L 3 Replies Last reply
        0
        • A Antti Keskinen

          Unfortunately I cannot give my e-mail address, and I don't use ICQ. First, go and download and install the latest version of the Microsoft RDP Client ActiveX Control. You can find it here[^]. After the control is installed, browse to the directory where you installed it. You can find a 'default.htm' test page there. Open it up on your browser, and you'll get a test page. Use this test page to connect to the TS client like you normally would. If the connection fails, the problem resides in the TS Server, and not in your end. After installing, if you have Windows XP, you'll have two RDP Client controls. The one we just installed is called 'Microsoft RDP Client (redist)'. Use OLE/COM Viewer tool to browse through it's type library. When/If the connection was succesfull, the control is tested and you can use the it anywhere you need. I have created a small example application that connects to a server IP you provide it with, and displays the login screen. The code is commented heavily, and the interesting parts are in the Connect and Disconnect buttons click handlers. Works smoothly for me. The example application is not very usable, as the display area is very small. But it'll show you how it's done. Note that in order to disconnect my application from the TS Server, you must first click outside the RDP Desktop screen, then click on Disconnect button. You can download the source code and the example application from http://www.tpu.fi/~t1akeski/TSClient.zip. It is written with VC++ .Net 2003. As for the problem you described, then an answer is written to MSDN: The control connects asynchronously, so a return from a Connect call indicates only that the connection has been initiated successfully, not that it has been completed. You should respond to events on the IMsTscAxEvents interface to determine when the control has successfully connected (or has been disconnected). -Antti Keskinen ---------------------------------------------- The definition of impossible is strictly dependant on what we think is possible.

          4 Offline
          4 Offline
          4apai
          wrote on last edited by
          #5

          Antti, THX A LOT!!! at last, i c a light at the end of tunnel:) if u need some help with vc++, ask me! if it'll be in my competence - wait for nice reply. best regards.

          1 Reply Last reply
          0
          • A Antti Keskinen

            Unfortunately I cannot give my e-mail address, and I don't use ICQ. First, go and download and install the latest version of the Microsoft RDP Client ActiveX Control. You can find it here[^]. After the control is installed, browse to the directory where you installed it. You can find a 'default.htm' test page there. Open it up on your browser, and you'll get a test page. Use this test page to connect to the TS client like you normally would. If the connection fails, the problem resides in the TS Server, and not in your end. After installing, if you have Windows XP, you'll have two RDP Client controls. The one we just installed is called 'Microsoft RDP Client (redist)'. Use OLE/COM Viewer tool to browse through it's type library. When/If the connection was succesfull, the control is tested and you can use the it anywhere you need. I have created a small example application that connects to a server IP you provide it with, and displays the login screen. The code is commented heavily, and the interesting parts are in the Connect and Disconnect buttons click handlers. Works smoothly for me. The example application is not very usable, as the display area is very small. But it'll show you how it's done. Note that in order to disconnect my application from the TS Server, you must first click outside the RDP Desktop screen, then click on Disconnect button. You can download the source code and the example application from http://www.tpu.fi/~t1akeski/TSClient.zip. It is written with VC++ .Net 2003. As for the problem you described, then an answer is written to MSDN: The control connects asynchronously, so a return from a Connect call indicates only that the connection has been initiated successfully, not that it has been completed. You should respond to events on the IMsTscAxEvents interface to determine when the control has successfully connected (or has been disconnected). -Antti Keskinen ---------------------------------------------- The definition of impossible is strictly dependant on what we think is possible.

            4 Offline
            4 Offline
            4apai
            wrote on last edited by
            #6

            do u've any idea on the next: i dont need to interract with desktop, dont wnat to c any passworddialogs and so on. i just need to make a connection, do smth (run program), and ten disconnect. any ideas?

            A 1 Reply Last reply
            0
            • 4 4apai

              do u've any idea on the next: i dont need to interract with desktop, dont wnat to c any passworddialogs and so on. i just need to make a connection, do smth (run program), and ten disconnect. any ideas?

              A Offline
              A Offline
              Antti Keskinen
              wrote on last edited by
              #7

              This is not possible in VC++, because the IMsTscNonScriptable interface that is required to set the password for automatic logon is not exposed by the Microsoft RDP Client Control. This is a design issue by Microsoft, they made it this way. It is possible in VB .Net, because it doesn't care whether an interface is exposed or not. However, using it also requires some specific settings in-place for the Terminal Server. For more information, read the Knowledge Base -article Q281417 here[^]. Unfortunately I cannot help you any forwards. The easiest way to directly execute a program in a Terminal Services environment is to use the Remote Desktop Connection program and it's templates, which support automatically logging on and executing an application when the TS connection is opened. -Antti Keskinen ---------------------------------------------- The definition of impossible is strictly dependant on what we think is possible.

              4 1 Reply Last reply
              0
              • A Antti Keskinen

                This is not possible in VC++, because the IMsTscNonScriptable interface that is required to set the password for automatic logon is not exposed by the Microsoft RDP Client Control. This is a design issue by Microsoft, they made it this way. It is possible in VB .Net, because it doesn't care whether an interface is exposed or not. However, using it also requires some specific settings in-place for the Terminal Server. For more information, read the Knowledge Base -article Q281417 here[^]. Unfortunately I cannot help you any forwards. The easiest way to directly execute a program in a Terminal Services environment is to use the Remote Desktop Connection program and it's templates, which support automatically logging on and executing an application when the TS connection is opened. -Antti Keskinen ---------------------------------------------- The definition of impossible is strictly dependant on what we think is possible.

                4 Offline
                4 Offline
                4apai
                wrote on last edited by
                #8

                Annti, sorri. this question is not already actual. i'd already implemented it last evening. and its possible. IMsTscNonScriptable interface is exposing. i'd acquaint with msrdp documentation and found the way to do it. bytheway. vc++ is more powerfull than vb, so if it posiible there then it is total-lot possible in vc++ ;) if u r interested mail me. -M4apai Icedis -------------------------------- There are no impossible tasks. There are tasks that needed infinite quantity of time.

                W 1 Reply Last reply
                0
                • A Antti Keskinen

                  Unfortunately I cannot give my e-mail address, and I don't use ICQ. First, go and download and install the latest version of the Microsoft RDP Client ActiveX Control. You can find it here[^]. After the control is installed, browse to the directory where you installed it. You can find a 'default.htm' test page there. Open it up on your browser, and you'll get a test page. Use this test page to connect to the TS client like you normally would. If the connection fails, the problem resides in the TS Server, and not in your end. After installing, if you have Windows XP, you'll have two RDP Client controls. The one we just installed is called 'Microsoft RDP Client (redist)'. Use OLE/COM Viewer tool to browse through it's type library. When/If the connection was succesfull, the control is tested and you can use the it anywhere you need. I have created a small example application that connects to a server IP you provide it with, and displays the login screen. The code is commented heavily, and the interesting parts are in the Connect and Disconnect buttons click handlers. Works smoothly for me. The example application is not very usable, as the display area is very small. But it'll show you how it's done. Note that in order to disconnect my application from the TS Server, you must first click outside the RDP Desktop screen, then click on Disconnect button. You can download the source code and the example application from http://www.tpu.fi/~t1akeski/TSClient.zip. It is written with VC++ .Net 2003. As for the problem you described, then an answer is written to MSDN: The control connects asynchronously, so a return from a Connect call indicates only that the connection has been initiated successfully, not that it has been completed. You should respond to events on the IMsTscAxEvents interface to determine when the control has successfully connected (or has been disconnected). -Antti Keskinen ---------------------------------------------- The definition of impossible is strictly dependant on what we think is possible.

                  L Offline
                  L Offline
                  lokimeg
                  wrote on last edited by
                  #9

                  Hello Antti !!! 1.) The URL you provided doesn't work now. I'm also trying to make an activeX COM client for RDP connections. Can you please upload the code again & send the URL ? 2.) How can we create the instance pointer of IMsTscAx interface class? code:-

                  void Connect()

                  {//*pInterface pointer will be used to call the methods to make rdp connection

                  IMsTscAx *pInterface;
                  CLSID clsid = __uuidof(MSTSCLib::MsTscAx);
                  IID iid = __uuidof(MSTSCLib::IMsTscAx);

                  HRESULT hrInterface=CoCreateInstance(clsid,NULL,CLSCTX_INPROC_SERVER,iid,void**)&pInterface);

                  /* but here pInterface becomes NULL because clsid = __uuidof(MSTSCLib::MsTscAx)is not a valid value but if I use clsid = __uuidof(MSTSCLib::MsRdpClient2) then clsid comes out to a valid value {CLSID_MicrosoftRDP Client Control (redist)} and interface pointer pInterface also gets filled n initialized, but then after setting all the rdp connection parameters, HRESULT hrConnect = pInterface->Connect() doesn't work though hrConnect gives success message. */

                  pInterface->PutDomain("spider.net");
                  pInterface->PutServer("192.168.10.195");
                  HRESULT hrConnect = pInterface->Connect();

                  }

                  Is there any other way(besides done in my code) to fill this interface pointer *pInterface ?? Please help. Regards, Lokesh

                  A 1 Reply Last reply
                  0
                  • L lokimeg

                    Hello Antti !!! 1.) The URL you provided doesn't work now. I'm also trying to make an activeX COM client for RDP connections. Can you please upload the code again & send the URL ? 2.) How can we create the instance pointer of IMsTscAx interface class? code:-

                    void Connect()

                    {//*pInterface pointer will be used to call the methods to make rdp connection

                    IMsTscAx *pInterface;
                    CLSID clsid = __uuidof(MSTSCLib::MsTscAx);
                    IID iid = __uuidof(MSTSCLib::IMsTscAx);

                    HRESULT hrInterface=CoCreateInstance(clsid,NULL,CLSCTX_INPROC_SERVER,iid,void**)&pInterface);

                    /* but here pInterface becomes NULL because clsid = __uuidof(MSTSCLib::MsTscAx)is not a valid value but if I use clsid = __uuidof(MSTSCLib::MsRdpClient2) then clsid comes out to a valid value {CLSID_MicrosoftRDP Client Control (redist)} and interface pointer pInterface also gets filled n initialized, but then after setting all the rdp connection parameters, HRESULT hrConnect = pInterface->Connect() doesn't work though hrConnect gives success message. */

                    pInterface->PutDomain("spider.net");
                    pInterface->PutServer("192.168.10.195");
                    HRESULT hrConnect = pInterface->Connect();

                    }

                    Is there any other way(besides done in my code) to fill this interface pointer *pInterface ?? Please help. Regards, Lokesh

                    A Offline
                    A Offline
                    Antti Keskinen
                    wrote on last edited by
                    #10

                    Hi Lokesh, It's been a while since I dealt with this issue. But the URL works just fine. I just tested it. Might've been a hiccup at the Microsoft end, or perhaps you cannot access it for some other reason? But rest assured, the website is there. I can't upload the code. I would be violating Microsoft's ToS. Please visit the web-site in the link. As for your second question, you can't. The IMsTscAx is an interface exposed by the Remote Desktop ActiveX Control. What you need to do is instantiate the RDAC itself, and query it for the IMsTscAx interface. I can't remember the RDAC's CLSID value out of the top of my head, so you'll need to use the OLE/COM Object Browser tool in order to determine it. It might be the CLSID_MsRdpClient2 you discovered) Once you have the CLSID, call CoCreateInstance with it and query for the target interface. If this fails, ask the object for IUnknown first and use the returned pointer to query for the IMsTscAx. All COM objects support IUnknown, so if you have the CLSID correct, you should be able to get it at least. If the IMsTscAx interface query returns a failure through IUnknown::QueryInterface, at least you'll have more details on why and how it fails. As for the reasons why the 'Connect' call refuses to work, I can't say. There are numerous reasons why a Remote Desktop connection may fail, and not all of them are related directly to code. Perhaps the service is disabled? Perhaps access is prohibited? You should first try to connect to the Remote Desktop service by manually using the RDS software (Found in Start -> Programs -> Accessories -> Remote Desktop Connection). If you can connect manually to the host computer, then try the code-wise approach. Regards, Antti

                    ------------------------------ Programming Windows is like a box of assorted chocolates. You never know what you're going to get.

                    1 Reply Last reply
                    0
                    • 4 4apai

                      Annti, sorri. this question is not already actual. i'd already implemented it last evening. and its possible. IMsTscNonScriptable interface is exposing. i'd acquaint with msrdp documentation and found the way to do it. bytheway. vc++ is more powerfull than vb, so if it posiible there then it is total-lot possible in vc++ ;) if u r interested mail me. -M4apai Icedis -------------------------------- There are no impossible tasks. There are tasks that needed infinite quantity of time.

                      W Offline
                      W Offline
                      wangycol
                      wrote on last edited by
                      #11

                      Hello, Can I refer to your code about the client of MSTSCAX ActiveX Ctrl. In vb, I can do it easily

                      Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
                      AxMsRdpClient71.Server = "172.16.112.33"
                      AxMsRdpClient71.UserName = "gui.rs"
                      AxMsRdpClient71.AdvancedSettings6.ClearTextPassword = "1"
                      AxMsRdpClient71.Connect()
                      End Sub

                      but in vc, I cant create a member for activex mstscax.

                      1 Reply Last reply
                      0
                      Reply
                      • Reply as topic
                      Log in to reply
                      • Oldest to Newest
                      • Newest to Oldest
                      • Most Votes


                      • Login

                      • Don't have an account? Register

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • World
                      • Users
                      • Groups