Skip to content

Instantly share code, notes, and snippets.

@Z1000R
Z1000R / gist:8ab358bff7c9b266475d4f2cb2d640a8
Last active October 20, 2022 13:26
VBA (64bit) で FindFirstFileW (Unicode対応) を使用してファイル一覧を取得する。ファイルサイズが、2GB を超える場合の計算方法も含めてある。
Option Explicit
'////////////////////////////////////////////////////////////////////////////////////////////////////
' LICENSE
'////////////////////////////////////////////////////////////////////////////////////////////////////
'Copyright 2022 Z1000R
'
'Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
'associated documentation files (the "Software"), to deal in the Software without restriction,
'including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
@Z1000R
Z1000R / SafeArrayGetDim.bas
Last active September 29, 2022 12:54
【VBA】SafeArrayGetDim を使って、配列の次元数を求める
Option Explicit
'引数は、SAFEARRAY を指すポインタを値渡し
Private Declare PtrSafe Function SafeArrayGetDim Lib "oleaut32" (ByVal psa As LongPtr) As Long
'Source:
' ByRef :Sourceに格納されている「値」をDestinationにコピーする
' ByVal :Sourceに格納されている「アドレスにある値」をDestinationにコピーする
' ByVal VarPtr(v) + Offset :変数v から Offset 移動したアドレスにある値をDestinationにコピーする
'Remarks