GetSafeArrayPointer: Unterschied zwischen den Versionen

Aus API-Wiki
Wechseln zu: Navigation, Suche
Zeile 3: Zeile 3:
  
  
  Private Declare Sub GetSafeArrayPointer Lib "msvbvm60.dll" Alias "GetMem4" (pArray() As Any, sfaPtr As Long)
+
  Private Declare Sub GetSafeArrayPointer _
 +
Lib "msvbvm60.dll" Alias "GetMem4" (pArray() As Any, sfaPtr As Long)
  
Private Sub Command1_Click()
 
  
 
  Dim mArray() As Long
 
  Dim mArray() As Long
Zeile 16: Zeile 16:
 
  Call GetSafeArrayPointer(mArray, pSafeArray)
 
  Call GetSafeArrayPointer(mArray, pSafeArray)
 
  MsgBox (pSafeArray <> 0)
 
  MsgBox (pSafeArray <> 0)
 
End Sub
 

Version vom 7. März 2008, 10:30 Uhr

liefert einen Pointer zu einem Array, ist dieser 0 (Null), ist das Array (noch) nicht dimensioniert


Private Declare Sub GetSafeArrayPointer _
Lib "msvbvm60.dll" Alias "GetMem4" (pArray() As Any, sfaPtr As Long)


Dim mArray() As Long
Dim pSafeArray As Long
  
Call GetSafeArrayPointer(mArray, pSafeArray)
MsgBox (pSafeArray <> 0)
  
ReDim mArray(5)
Call GetSafeArrayPointer(mArray, pSafeArray)
MsgBox (pSafeArray <> 0)