[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework

Displaying an ActiveX in a Web Form (or a WPF form

Oriane

8/20/2008 3:21:00 PM

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

5 Answers

Oriane

8/20/2008 4:22:00 PM

0

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

v-mazho

8/21/2008 4:27:00 AM

0

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/Ketwau...
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.

Oriane

8/21/2008 8:36:00 AM

0

Hi Marco,
"Marco Zhou [MSFT]" <v-mazho@online.microsoft.com> 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...
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.

Oriane

8/21/2008 8:55:00 AM

0

Ok Marco,

I've replaced NavigateToString with DocumentText for a Windows form and it's
ok...

v-mazho

8/25/2008 7:44:00 AM

0

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.