-
use of the Microsoft.VisualBasic.Compatibility namespace
I am working on a VB .NET project that must use an OCX control (supplied by
the customer). The interop service seems to be working pretty OK here, but
one of the things we get from the OCX is an IPictureDisp. In VB6, we could
simply assign this to a PictureBox.Picture property to display the graphic.
Someone tipped me on the use of
Microsoft.VisualBasic.Compatibility.VB6.IPictureDispToImage to convert the
IPictureDisp for the .NET PictureBox's Image - and that works, but I feel a
bit uneasy about using the compatibility library. Otherwise, the project is
pure VB .NET (no other uses for the cmpatibility reference).
I am a VB6 veteran comming up to speed on .NET and am soloiciting opinions
on this issue ... any takers??
Thx,
Mark
-
Re: use of the Microsoft.VisualBasic.Compatibility namespace
"Mark Bax" <markb@blaisesoft.com> wrote in message
news:3d48298f$1@10.1.10.29
<cut>
> but I feel a bit uneasy about using the compatibility library.
> Otherwise, the project is pure VB .NET (no other uses for the
> cmpatibility reference).
the project is already using COM interop to work with the older protocols;
the VB6 compatibility library would be less of an issue than that IMO
-
Re: use of the Microsoft.VisualBasic.Compatibility namespace
On Wed, 31 Jul 2002 14:39:24 -0400, "Mark Bax" <markb@blaisesoft.com>
wrote:
>Someone tipped me on the use of
>Microsoft.VisualBasic.Compatibility.VB6.IPictureDispToImage to convert the
>IPictureDisp for the .NET PictureBox's Image - and that works, but I feel a
>bit uneasy about using the compatibility library.
You can always decompile the part you're interested in and then extract
the useful parts.
See: http://www.saurik.com/net/exemplar/
--
*--------={ Fine Art for .NET }=--------*
| .Net Components @ www.abderaware.com |
*---------------------------------------*
Turn on, tune in, download.
zane a@t abderaware.com
-
Re: use of the Microsoft.VisualBasic.Compatibility namespace
Hi Mark,
"Mark Bax" <markb@blaisesoft.com> wrote in message
news:3d48298f$1@10.1.10.29...
> I am working on a VB .NET project that must use an OCX control (supplied
by
> the customer). The interop service seems to be working pretty OK here, but
> one of the things we get from the OCX is an IPictureDisp. In VB6, we could
> simply assign this to a PictureBox.Picture property to display the
graphic.
>
> Someone tipped me on the use of
> Microsoft.VisualBasic.Compatibility.VB6.IPictureDispToImage to convert the
> IPictureDisp for the .NET PictureBox's Image - and that works, but I feel
a
> bit uneasy about using the compatibility library. Otherwise, the project
is
> pure VB .NET (no other uses for the cmpatibility reference).
>
> I am a VB6 veteran comming up to speed on .NET and am soloiciting opinions
> on this issue ... any takers??
I haven't tried it, but AxHost.GetPictureFromIPictureDisp (in
System.Windows.Forms) looks promising. Whereas it is a protected method,
you'd have to inherit from AxHost to get access to it. Also, the
documentation warns: "This member supports the .NET Framework infrastructure
and is not intended to be used directly from your code." Caveat emptor.
Regards,
Dan
-
Re: use of the Microsoft.VisualBasic.Compatibility namespace
Hi,
Personally, I would just use it. Interop is there for this reason. Sure,
there may be issues... but the answer to current applications is not to wait
for the vendor to create a .NET control or class. Who knows, both you and
he may be in a different business by then.
--
Richard Grier (Microsoft Visual Basic MVP)
See www.hardandsoftware.net for contact information.
Author of Visual Basic Programmer's Guide to Serial Communications, 3rd
Edition ISBN 1-890422-27-4 (391 pages) published February 2002.
-
Re: use of the Microsoft.VisualBasic.Compatibility namespace
"Mark Bax" <markb@blaisesoft.com> wrote in message
news:3d48298f$1@10.1.10.29...
> I am working on a VB .NET project that must use an OCX control (supplied
by
> the customer). The interop service seems to be working pretty OK here, but
> one of the things we get from the OCX is an IPictureDisp. In VB6, we could
> simply assign this to a PictureBox.Picture property to display the
graphic.
>
> Someone tipped me on the use of
> Microsoft.VisualBasic.Compatibility.VB6.IPictureDispToImage to convert the
> IPictureDisp for the .NET PictureBox's Image - and that works, but I feel
a
> bit uneasy about using the compatibility library. Otherwise, the project
is
> pure VB .NET (no other uses for the cmpatibility reference).
>
> I am a VB6 veteran comming up to speed on .NET and am soloiciting opinions
> on this issue ... any takers??
Unfortunately, Microsoft has got its public messages awfully confused on
that one.
This came up a few months ago in the group
microsoft.public.dotnet.languages.vb.upgrade, which several MS people
participated in, including Ed Robinson, who is Program Manager for VB.NET.
Rather then editorialize on it, I'll simply give you a link to the whole
thread, so you can decide for yourself what they mean.
http://groups.google.com/groups?hl=e...fe=off&th=e413
9777af0d64af&seekm=fMJYqOM3BHA.1752%40cpmsftngxa08&frame=off
--
Regards
Jonathan West
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks