GetSafeArrayPointer: Unterschied zwischen den Versionen

Aus API-Wiki
Wechseln zu: Navigation, Suche
Zeile 2: Zeile 2:
  
  
Option Explicit
 
  
Private Declare Sub GetSafeArrayPointer Lib "msvbvm60.dll" Alias "GetMem4" _
+
Private Declare Sub GetSafeArrayPointer Lib "msvbvm60.dll" Alias "GetMem4" (pArray() As Any, sfaPtr As Long)
                    (pArray() As Any, sfaPtr As Long)
 
  
Private Sub Command1_Click()
+
Private Sub Command1_Click()
  
 
   Dim mArray() As Long
 
   Dim mArray() As Long
Zeile 18: Zeile 16:
 
   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:26 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