掲示板システム
ホーム
アクセス解析
カテゴリ
ログアウト
メモリクリーナーの作成 (ID:109893)
名前
ホームページ(ブログ、Twitterなど)のURL (省略可)
本文
メモリクリーナーをVBで作成しています。 しかし、現在の方法ではうまくメモリの解放ができません。 Private Declare Function VirtualAlloc Lib "kernel32" (lpAddress As Any, ByVal dwSize As Long, ByVal flAllocationType As Long, ByVal flProtect As Long) As Long Private Declare Function VirtualFree Lib "kernel32" (lpAddress As Any, ByVal dwSize As Long, ByVal dwFreeType As Long) As Long Private Declare Sub FillMemory Lib "kernel32" Alias "RtlFillMemory" (dest As Any, ByVal numBytes As Long, ByVal Fill As Byte) Dim lpMem as long 'アドレス保存用変数 Dim lngByte as Long '掃除するサイズ '掃除するメモリーのサイズを設定 lngByte=Val(Command$) 'コマンドラインからサイズを決定 If lngByte=0 Then lngByte=32 '未指定で32メガバイトとする lngByte=lngByte * 1024& * 1024& 'メガバイトをバイトに変換 'メモリーの掃除 lpMem=VirtualAlloc(ByVal 0, lngByte, &H1000, &H4 Or &H200) Call FillMemory(ByVal lpMem, lngByte, 0) Call VirtualFree(lpMem, lngByte, MEM_RELEASE) ↑でメモリーの掃除はできているのでしょうか。教えてください。
←解決時は質問者本人がここをチェックしてください。
戻る
掲示板システム
Copyright 2021 Takeshi Okamoto All Rights Reserved.