Created
May 13, 2015 21:31
-
-
Save kumatti1/6236e7dc31d3cdd5311c to your computer and use it in GitHub Desktop.
配列の初期化チェック
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Option Explicit | |
Private Declare PtrSafe _ | |
Function VarPtr Lib "vbe7.dll" ( _ | |
ByRef arr() As Any _ | |
) As LongPtr | |
Private Declare PtrSafe _ | |
Sub RtlMoveMemory Lib "Kernel32.dll" ( _ | |
ByRef Destination As Any, _ | |
ByRef Source As Any, _ | |
ByVal Length As LongPtr _ | |
) | |
Sub hoge() | |
#If Win64 Then | |
Dim arr() As LongPtr | |
Dim pp As LongPtr | |
Dim p As LongPtr | |
pp = VarPtr(arr) | |
RtlMoveMemory p, ByVal pp, 8 | |
If p Then | |
Debug.Print "初期化済み" | |
Else | |
Debug.Print "未初期化" | |
End If | |
#End If | |
End Sub |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment