Thanks Armin, see below
"Armin Zingler" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Am 14.07.2010 17:17, schrieb mp:
>> Before I set option strict on i was able to work with arrays as objects
>> similar to vb6 variants
>> what i mean by that is the following lines worked in my app
>> Dim vMin As Object = Nothing, vMax As Object = Nothing
>>
>> oRegion.GetBoundingBox(vMin, vMax)
>>
>> and the GetBoundingBox method filled the arrays as required (3 element
>> arrays of doubles)
>>
>> .................
>>
>> when i changed to option strict on i had to change the lines above to
>>
>> Dim vMin As Double() = New Double(0 To 2) {}
>>
>> Dim vMax As Double() = New Double(0 To 2) {}
>>
>> 'convert array to object
>>
>> oRegion.GetBoundingBox(CType(vMin, Object), CType(vMax, Object))
>>
>> but now the arrays are not filled...they appear to be all zeros
>>
>> how do i solve this dilema?
>>
>> the .GetBoundingBox method args are (vMin as Object, vMax as Object)
>>
>> in vb6 they would have been variants and would return 3 element arrays of
>> doubles
>
> Why not declare
> GetBoundingBox (byref vMin as double(), byref vMax as double())
> ?
Because I didn't write it - that is a method on an autocad object
> Then you can just call
> oRegion.GetBoundingBox(vMin, vMax)
> like before.
>
>
> The reason that it doesn't work with "CType(vMin, Object)" is that
> "CType(vMin, Object)" is an expression. Before the method is called,
> the expression is calculated and stored in a temporary place.
> Inside GetBoundingBox, the content does change, but after the method
> returns you don't have access to that temporary value.
>
so can I do like:
Dim oVarMin as Object
oVarMin = Ctype(vMin, Object)
???
would that capture the permanent object?
then do GetBoundingBox(oVarMin, oVarMax)
?
guess i'll try and find out
> --
> Armin
|