Re: 3rd and Final Post OCX Design Question

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Ken,

Thanks for the post. I was beginning to give up on this post being answered.
Your comments make sense and I will test them out. Thanks. I didn't know
whether there would be any difference in speed hit by creating the array on
the client and passing a reference to the array or passing the picture and
adding it to an array in the OCX. I think the former would be quickest.

Thanks.

Alastair MacFarlane

"Ken Halter" wrote:

> "Alastair MacFarlane" <AlastairMacFarlane@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote
> in message news:C17220F1-4B9C-46F6-9C46-8F165C39EC21@xxxxxxxxxxxxxxxx
> > Dear All
> >
> > What is the difference between passing a picture as IPictureDisp as
> > Variant
> > or Object between a client application and a dll/OCX? i.e speed, size,
> > etc. I
> > want to be able to resize the image passed in the OCX.
>
> Seems that people are ignoring this question <g>. I've never written an app
> that passes graphics around so I can only "assume" that passing them as
> IPictureDisp would be best. On the other hand, if you leave it up to VB's
> control wizard, it'll suggest that you pass it like....
>
> ByVal New_Picture As Picture
>
> ....either way, since it's an object, you're really only passing 4 bytes...
> the reference to the object (assuming again).
>
> As far as passing them one at a time or part of an array (left over from
> your last question), it should be easy enough to add support for both
> methods. The array should be faster if it's already built in the "client"
> app, since, again, you're only passing a reference to the array.. not the
> contents.
>
> Public Sub PassPictures(ByRef New_Picture() As Picture)
>
> .....in the long run, you can benchmark this stuff yourself using something
> from this sample....
>
> StopWatch
> "Benchmark your code with millisecond resolution"
> http://vb.mvps.org/samples/
>
> ....and, you can track memory usage with this (very handy) utility (freeware)
>
> Process Viewer for Windows
> http://www.xmlsp.com/pview/prcview.htm
>
> --
> Ken Halter - MS-MVP-VB - http://www.vbsight.com
> Sign up now to help keep VB support alive - http://classicvb.org/petition
> Please keep all discussions in the groups..
>
>
>
.



Relevant Pages

  • Re: displaying pictures in perl from mysql database
    ... was received from the entity known as Oli Waters: ... I want to display a picture of the ... I'm guessing that DBQuery puts an array of arrayrefs into @rs, ... tree of your web or ftp server for you to be able to reference them like ...
    (comp.lang.perl.misc)
  • Re: Passing arrays ByVal vs ByRef
    ... the value itself if you are passing a Value Type. ... the reference to the value if you are passing a Reference ... reference type (such as an Array), you get a copy of the reference (the ... not the object data that is being passed-by-value, ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Can I get COBOL to look in a mirror?...
    ... > how do I reference each member of each structure? ... any 01 level with subsiduary items. ... > an array or structure is the table that I am passing as an argument ... You are not passing an 'array', you are passing a record. ...
    (comp.lang.cobol)
  • Re: Passing an array of chars to a function
    ... The array that it ... >> According to your idea there is no array here it's simply a pointer. ... > Passing by reference means passing a reference. ...
    (comp.lang.cpp)
  • Re: Passing arrays ByVal vs ByRef
    ... You can certainly pass an Array by ByRef, ... you'd be passing a copy of the pointer to the Array in ... memory (a copy of a reference that points to the object).. ...
    (microsoft.public.dotnet.languages.vb)