Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm General / April 2005

Tip: Looking for answers? Try searching our database.

Using .NET windows forms controls in an _embedded_ browser control

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Manny Vellon - 15 Apr 2005 20:30 GMT
I'm interested in using .net windows forms controls (datagrid, etc.) in my
app. My app, however, uses an embedded web browser control for its UI (for
easier content authoring). Pages are loaded locally (using file:// urls).

I've read examples of how to do this with IE and http protocol, but can it
be done locally with file protocol? I've tried:

<object classid="file:foo.dll#BarNS.Class" ...

As well as "foo.dll#Bar.NS.Class" and many other more options but all I get
is the old red "x".

Is it impossible to do this?
Dmytro Lapshyn [MVP] - 19 Apr 2005 07:33 GMT
Hi Manny,

Not tested this, but it appears that your file URL is malformed. Here's how
I'd write it:

<object classid="file:///./foo.dll#BarNS.Class" ...

Signature

Sincerely,
Dmytro Lapshyn [Visual Developer - Visual C# MVP]

> I'm interested in using .net windows forms controls (datagrid, etc.) in my
> app. My app, however, uses an embedded web browser control for its UI (for
[quoted text clipped - 9 lines]
>
> Is it impossible to do this?
Manny Vellon - 19 Apr 2005 16:06 GMT
Thanks, Dmytro, I've tried a bunch of alternatives, though, and I believe
(based on my readings) that IE only supports http protocol here. This is
unfortunate as it means that using IE without a web server to serve up pages
with winforms controls is not possible. I'd prefer to not have to run
Cassini just to deal with this problem.

I have discovered a somewhat painful alternative, however: I can use a C++
.net shim to load my C# Winforms control. The shim is an activex control
implemented in ATL7 that loads my control indirectly. I'm sure I'll have to
struggle with some container issues, but it's a promising avenue.

> Hi Manny,
>
[quoted text clipped - 17 lines]
>>
>> Is it impossible to do this?
ryanyoder@hotmail.com - 19 Apr 2005 22:20 GMT
You could also register the object for interop and load it with the
object tag and GUID.
Example here.

http://support.microsoft.com/default.aspx?scid=kb;en-us;Q305624

I am doing this but have a problem.  I need to be able to load the
app.config file for this control and I don't know if its possible using
the anonymously generated appDomain that gets created.

That shim idea may be an alternative that works for me.
Dmytro Lapshyn [MVP] - 20 Apr 2005 11:08 GMT
Interesting...I remember that Microsoft told some time ago that while COM
interop was fully supported by the framework, an ability to expose WinForms
user controls as ActiveX controls had been removed from the 1.0 release due
to certain problems it had.

Probably the story is different with IE which supports so-called lightweight
ActiveX controls, probably the framework supports those.

As for the app.config, it seems to be tough luck - I am not sure what to
advise.

Signature

Sincerely,
Dmytro Lapshyn [Visual Developer - Visual C# MVP]

> You could also register the object for interop and load it with the
> object tag and GUID.
[quoted text clipped - 7 lines]
>
> That shim idea may be an alternative that works for me.

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.