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()
 
  Private Sub Command1_Click()
  
  Dim mArray() As Long
+
Dim mArray() As Long
  Dim pSafeArray As Long
+
Dim pSafeArray As Long
 
    
 
    
  Call GetSafeArrayPointer(mArray, pSafeArray)
+
Call GetSafeArrayPointer(mArray, pSafeArray)
  MsgBox (pSafeArray <> 0)
+
MsgBox (pSafeArray <> 0)
 
    
 
    
  ReDim mArray(5)
+
ReDim mArray(5)
  Call GetSafeArrayPointer(mArray, pSafeArray)
+
Call GetSafeArrayPointer(mArray, pSafeArray)
  MsgBox (pSafeArray <> 0)
+
MsgBox (pSafeArray <> 0)
 +
 
  End Sub
 
  End Sub

Version vom 7. März 2008, 11:27 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)
Private Sub Command1_Click()
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)

End Sub