use of the Microsoft.VisualBasic.Compatibility namespace


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 6 of 6

Thread: use of the Microsoft.VisualBasic.Compatibility namespace

  1. #1
    Mark Bax Guest

    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



  2. #2
    Bob Butler Guest

    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




  3. #3
    Zane Thomas Guest

    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

  4. #4
    Daniel Pratt Guest

    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



  5. #5
    Dick Grier Guest

    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.




  6. #6
    Jonathan West Guest

    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
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center