use AxImp /source to remove AxMSTSCLib.dll

Mar 18, 2009 at 6:02 AM

you can use AxImp /source c:\windows\system32\MSTSC.dll to generate the source code of AxMSTSCLib.dll(AxMSTSCLib.cs), then you can include it in your project, thus you do not need AxMSTSCLib.dll.

what's more, you can even remove MSTSCLib.dll by manually defining the interface classes.

Coordinator
Mar 19, 2009 at 7:24 AM
I tried that AxImp, looks great, but did not do well.

It generated the C# code allright, but didn't generate all properties.. how do I specify a class to be generated?
Mar 19, 2009 at 8:20 AM
it works as expected here, do not use AxMsTscAx, but use AxMsRdpClient
Coordinator
Mar 19, 2009 at 9:19 AM
Edited Mar 19, 2009 at 9:20 AM
Ok let's compare the generaeted code

Just the name space and some variable

namespace AxMSTSCLib {
    
    
    [System.Windows.Forms.AxHost.ClsidAttribute("{a41a4187-5a86-4e26-b40a-856f9035d9cb}")]
    [System.ComponentModel.DesignTimeVisibleAttribute(true)]
    [System.ComponentModel.DefaultEvent("OnConnecting")]
    public class AxMsTscAx : System.Windows.Forms.AxHost {
        
        private MSTSCLib.IMsTscAx ocx; // << OLD CLASS, WHICH DOESN'T SUPPORT LOT OF FEATURES

..... // .....

   }
}

Sorry for those capital letters.

Anyway, I am assuming you have at least MSTSCLib.IMsRdpClient2 ?
Mar 19, 2009 at 9:53 AM
I'm using windows 2003, here is my code:

http://files.cnblogs.com/unruledboy/remotedesktop.zip
Coordinator
Mar 19, 2009 at 12:28 PM
Thanks. Let me check that.
Coordinator
Mar 20, 2009 at 12:44 AM
Finally working now @unruledboy, thanks! :)

It even fixed the Event issue.
Mar 20, 2009 at 8:43 AM
good to here that. I think that you like to separate biz logic to different dlls, for me, I like to have less dlls so I would include the WRAPPER into the client app :)