Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
DotNet
acad.assignment.mngr
academic
adonet
aspnet
aspnet.announcements
aspnet.build.controls
aspnet.caching
aspnet.datagridcontrol
aspnet.mobile
aspnet.security
aspnet.webcontrols
aspnet.webservices
clr
compactframework
component_services
datatools
distributed_apps
drawing
faqs
framework
framework.wmi
general
internationalization
interop
languages.csharp
languages.jscript
languages.vb
languages.vb.controls
languages.vb.data
languages.vb.upgrade
languages.vc
languages.vc.libraries
myservices
odbcnet
performance
remoting
scripting
sdk
security
setup
vjsharp
vsa
webservi.enhancements
webservices
windowsforms
windowsforms.controls
winforms.databinding
winforms.designtime
xml
  
 
date: Wed, 20 Aug 2008 17:21:28 +0200,    group: microsoft.public.dotnet.framework        back       


Displaying an ActiveX in a Web Form (or a WPF form)   
Hi there,
 
 Do I have to use the WebBrowser control ? If it is the case, how can I 
 achieve this, by building and loading an HTML document ?
 
 Best regards
date: Wed, 20 Aug 2008 17:21:28 +0200   author:   Oriane ail

Re: Displaying an ActiveX in a WinForm (or a WPF form)   
I think that my first post was not precise enough !

I would like want to dynamically show and use ActiveX (already installed on
the computer) in a WPF application. My first idea was to use a Web Browser
control (so inside a Windows Form :-( ) and then to create a HTML file with
a <object classid="clsid:{ED6BB178...> tag to be loaded into the WebBrowser.
But I didn't succeed in this way...and I need some help

I've tried this:
           webBrowser1.Navigate ("About:blank");
           webBrowser1.DocumentText = "<html><head><title>This is a
test</title></head><body>This is a <strong>test</strong></body></html>";
           webBrowser1.Show();

but nothing appears on the WebBrowser control...

Or perhaps can I do something much simpler ?

Best regards
date: Wed, 20 Aug 2008 18:21:34 +0200   author:   PhilTheGap

RE: Displaying an ActiveX in a Web Form (or a WPF form)   
Hello,
Welcome to Microsoft Newsgroup Support Service! My name is Marco Zhou. It's 
my pleasure to work with you on this thread.

I've tried to reproduce this issue you described above, here is my test 
code which could display the Flash player inside WPF application:

public WebBroweserHostDemo()
{
    InitializeComponent();
    WebBrowser webBrowser = new WebBrowser();
    this.Content = webBrowser;
    String html = @"<object classid='f5ff5d7d-a3aa-4ca4-9999-a42b6c33862d'>
                                <param name='movie' 
value='http://www.youtube.com/v/KetwauxzfEc'/>
                                <param name='wmode' value='transparent' />
                                <embed 
src='http://www.youtube.com/v/KetwauxzfEc' 
type='application/x-shockwave-flash' wmode='transparent' />
                        </object>";
    webBrowser.NavigateToString(html);
}

And the above code works well for me. WPF 3.5 SP1 has introduces a new 
WebBrowser control which you could directly use inside WPF application 
without using WindowsFormsHost. You could try it out to see if it fulfills 
your requirements.

Have you tried to display the HTML you programmatically constructed inside 
the Internet Explorer to see if IE could properly display it?

If IE cannot display it, you might not correctly construct the HTML, I 
would greatly appreciate it if you could post the full HTML you 
programmatically constructed in this thread, this would help us diagnose 
this issue, and if possible, it's event better if you could send the 
ActiveX control to us, so that we could try to reproduce this issue at our 
box.

--------------------------------------------------
Best regards,
Macro Zhou (v-mazho@online.microsoft.com, remove 'online.')
Microsoft Online Community Support

Delighting our customers is our #1 priority. We welcome your comments and 
suggestions about how we can improve the support we provide to you. Please 
feel free to let my manager know what you think of the level of service 
provided. You can send feedback directly to my manager at: 
msdnmg@microsoft.com.

This posting is provided "AS IS" with no warranties, and confers no rights.
date: Thu, 21 Aug 2008 04:26:39 GMT   author:   (Marco Zhou [MSFT])

Re: Displaying an ActiveX in a Web Form (or a WPF form)   
Hi Marco,
"Marco Zhou [MSFT]"  a écrit dans le message 
de news:9r0ukY0AJHA.1688@TK2MSFTNGHUB02.phx.gbl...
> Hello,
> Welcome to Microsoft Newsgroup Support Service! My name is Marco Zhou. 
> It's
> my pleasure to work with you on this thread.
>
> I've tried to reproduce this issue you described above, here is my test
> code which could display the Flash player inside WPF application:
Your code works fine.
Now I also would like to achieve the same behavior with a Windows Form 
application. So I've tried to replace NavigateToString by Navigate (a method 
of the WinForm WebBrowser) but I get an ArgumentException when running on 
Navigate.

public Form1()
        {
            InitializeComponent();

            String html = @"<object 
classid='CLSID:22D6f312-B0F6-11D0-94AB-0080C74C7E95'
                              codebase='http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6.4.7.1112' 
type='application/x-oleobject' >
                                <param name='Filename'
                                       value='http://srvdev/sites/RetD/gilif/Images%20gilif/Butterfly.wmv'/>
                                <param name='wmode' value='transparent' />
                                <embed
                                       src='http://srvdev/sites/RetD/gilif/Images%20gilif/Butterfly.wmv'
                                       type='application/x-shockwave-flash' 
wmode='transparent' />
                        </object>";
            webBrowser4.Navigate (html);
        }

Do you know why ?

Thanks again for your help.

PS:  I have problem with the News microsoft server: I cannot anymore send 
posts :-( That's why I post from a different server.
date: Thu, 21 Aug 2008 10:36:18 +0200   author:   PhilTheGap

Re: Displaying an ActiveX in a Web Form (or a WPF form)   
Ok Marco,

I've replaced NavigateToString with DocumentText for a Windows form and it's 
ok...
date: Thu, 21 Aug 2008 10:55:05 +0200   author:   PhilTheGap

Re: Displaying an ActiveX in a WinForm (or a WPF form)   
Hello,

Thanks for your update, we are glad to know that this issue has been 
resolved by yourself, if you continue having any further questions on this 
issue, free feel to post here.

--------------------------------------------------
Best regards,
Macro Zhou (v-mazho@online.microsoft.com, remove 'online.')
Microsoft Online Community Support

Delighting our customers is our #1 priority. We welcome your comments and 
suggestions about how we can improve the support we provide to you. Please 
feel free to let my manager know what you think of the level of service 
provided. You can send feedback directly to my manager at: 
msdnmg@microsoft.com.

This posting is provided "AS IS" with no warranties, and confers no rights.
date: Mon, 25 Aug 2008 07:43:46 GMT   author:   (Marco Zhou [MSFT])

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us