掲示板システム
ホーム
アクセス解析
カテゴリ
ログアウト
ファイルマッピングするには (ID:122064)
名前
ホームページ(ブログ、Twitterなど)のURL (省略可)
本文
VB.NETでメモリーマップトファイルを使ってスレッド間で巨大ファイル を共有したいのですが、どうしてもハンドルが帰ってきません 0=CreateFileMapping() となってしまいます。 よろしくご教授ください。 ======================================================= Dim hFileMap, hFile As Integer Dim filename As String filename = "new.txt" hFile = CreateFile(filename, GENERIC_WRITE \ GENERIC_READ, _ 0, 0, OPEN_EXISTING, 0, 0)<==成功(3592等の値) hFileMap = CreateFileMapping(hFile, 0, PAGE_READWRITE, _ 0, 0, "test")<==常に”0”失敗 ============================= Public Const GENERIC_READ As Integer = &H80000000 '読み込み Public Const GENERIC_WRITE As Integer = &H40000000 '書き込み Public Const GENERIC_WRITECOPY As Integer = &H10000000 '書き込み Public Const OPEN_EXISTING As Short = 3 'ファイルをオープンする。 Public Const OPEN_ALWAYS As Short = 4 Declare Function CreateFile Lib "KERNEL32" Alias "CreateFileA"_ (ByVal lpFileName As String, _ ByVal dwDesiredAccess As Integer,_ ByVal dwShareMode As Integer, _ ByVal lpSecurityAttributes As Integer, _ ByVal dwCreationDisposition As Integer, _ ByVal dwFlagsAndAttributes As Integer, _ ByVal hTemplateFile As Integer) As Integer Declare Function CreateFileMapping Lib "KERNEL32" Alias "CreateFileMappingA" (ByVal hFile As Integer, _ ByVal lpFileMappigAttributes As Integer, _ ByVal flProtect As Integer, _ ByVal dwMaximumSizeHigh As Integer, _ ByVal dwMaximumSizeLow As Integer, _ ByVal lpName As String) As Integer
←解決時は質問者本人がここをチェックしてください。
戻る
掲示板システム
Copyright 2020 Takeshi Okamoto All Rights Reserved.