Link to home
Start Free TrialLog in
Avatar of colindow
colindow

asked on

Visual Basic SafeArrayGetDim

What value does this API return. i.e. if I want to make sure that an arrray is dimensioned can I write code like

if safearraygetdim(myarray)>0 then
   its okay to go on
else
  stop
end if
SOLUTION
Avatar of anthonywjones66
anthonywjones66

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Avatar of Mike Tomlinson
Mike Tomlinson
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of colindow
colindow

ASKER

I think I follow but to presson the specifics safearraygetdim is this in the api

Public Declare Function SafeArrayGetDim Lib "OLEaut32.dll" (ByRef saArray() As Any) As Long

so what is the value for this api function that tells me my array is not dimensioned ?

Does this API call work with arraysof strings? (mine are!)
Here is an entire discussion on the topic:
http://www.vbadvance.com/arrays.htm
Thank you. As it it happens that was the article that started me wondering what the call safearraygetdim actually returns!
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I'd still be interested to know what the value that the  safearraygetdim api returns actually meany but between these answersI've got enough to make my program behave as I'd like so i guess thats an answer.
I'll split the points.