GetSafeArrayPointer: Unterschied zwischen den Versionen

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

Version vom 7. März 2008, 10:41 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 mArr() As Long
  Dim pSafeArr As Long
  
  Call GetSafeArrayPointer(mArr, pSafeArr)
  MsgBox (pSafeArr <> 0)
  
  ReDim mArr(5)
  Call GetSafeArrayPointer(mArr, pSafeArr)
  MsgBox (pSafeArr <> 0)