Re: 3rd and Final Post OCX Design Question
- From: "Alastair MacFarlane" <AlastairMacFarlane@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Wed, 4 May 2005 08:41:05 -0700
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..
>
>
>
.
- References:
- 3rd and Final Post OCX Design Question
- From: Alastair MacFarlane
- Re: 3rd and Final Post OCX Design Question
- From: Ken Halter
- 3rd and Final Post OCX Design Question
- Prev by Date: Re: 3rd and Final Post OCX Design Question
- Next by Date: Open for Output and Write
- Previous by thread: Re: 3rd and Final Post OCX Design Question
- Next by thread: Re: WebProjectCacheDirectory
- Index(es):
Relevant Pages
|