Tuesday, December 02, 2008 6:05 PMHi to all!
Can anybody help me?
I have an out-of process third-party ActiveX control. I just need to host it in the WPF Application. What should I do for it? I have not seen any examples of doing this in the internet.
P.S. This third-party out-of-process ActiveX Control was created in C++/Qt using ActiveQt
Thursday, December 04, 2008 3:31 AMHi,
Here is an useful document with a ready-to-run example of hosting ActiveX controls in your WPF based application, you can follow it step by step.
Some code snippets are shown in the following:
Title="Hosting the Terminal Services ActiveX Control">
<DockPanel Name="panel" Margin="10">
<StackPanel Margin="0,0,0,10" DockPanel.Dock="Top" Orientation="Horizontal">
<TextBox x:Name="serverBox" Width="200" Margin="0,0,10,0"/>
<Button x:Name="connectButton" Click="connectButton_Click">Connect</Button>
In the code behind:
public partial class Window1 : Window
// Create the host and the ActiveX control
WindowsFormsHost host = new WindowsFormsHost();
termServ = new AxMSTSCLib.AxMsTscAxNotSafeForScripting();
// Add the ActiveX control to the host, and the host to the WPF panel
host.Child = termServ;
void connectButton_Click(object sender, RoutedEventArgs e)
termServ.Server = serverBox.Text;
Hope this helps.
Jim Zhou -MSFT
- Marked As Answer by Jim Zhou - MSFT Friday, December 05, 2008 12:47 PM
Tuesday, May 15, 2012 10:06 AMThis one works but I cannot click on the program opened in the remote machines. I cannot start new program from the remote desktop session launched through this.