2012-01-17 70 views
-1

我需要使用內存映射文件來實現c中的某個虛擬文件系統。 我被列入WINBASE.H針對這種情況,但我有很多錯誤,從這個庫,如:文件系統 - 內存映射文件庫

Error 1 error C2061: syntax error : identifier 'PVOID' c:\program files (x86)\microsoft sdks\windows\v7.0a\include\winbase.h 250 1 FileIO 
Error 2 error C2059: syntax error : '}' c:\program files (x86)\microsoft sdks\windows\v7.0a\include\winbase.h 251 1 FileIO 
Error 3 error C2061: syntax error : identifier 'hEvent' c:\program files (x86)\microsoft sdks\windows\v7.0a\include\winbase.h 253 1 FileIO 
Error 4 error C2059: syntax error : ';' c:\program files (x86)\microsoft sdks\windows\v7.0a\include\winbase.h 253 1 FileIO 
Error 5 error C2059: syntax error : '}' c:\program files (x86)\microsoft sdks\windows\v7.0a\include\winbase.h 254 1 FileIO 
Error 6 error C2061: syntax error : identifier 'LPOVERLAPPED' c:\program files (x86)\microsoft sdks\windows\v7.0a\include\winbase.h 258 1 FileIO 
Error 7 error C2059: syntax error : '}' c:\program files (x86)\microsoft sdks\windows\v7.0a\include\winbase.h 261 1 FileIO 
Error 8 error C2061: syntax error : identifier 'LPVOID' c:\program files (x86)\microsoft sdks\windows\v7.0a\include\winbase.h 265 1 FileIO 
Error 9 error C2061: syntax error : identifier 'bInheritHandle' c:\program files (x86)\microsoft sdks\windows\v7.0a\include\winbase.h 266 1 FileIO 
Error 10 error C2059: syntax error : ';' c:\program files (x86)\microsoft sdks\windows\v7.0a\include\winbase.h 266 1 FileIO 
Error 11 error C2059: syntax error : '}' c:\program files (x86)\microsoft sdks\windows\v7.0a\include\winbase.h 267 1 FileIO 
Error 12 error C2016: C requires that a struct or union has at least one member c: 

...

我WINBASE.H之前包括intsafe.h。我是否需要包含另一個庫才能在c應用程序中使用winbase.h? 感謝您的建議

+0

你從來沒有在Stack Overflow上接受過單個答案。我認爲這是因爲你不知道該網站的工作原理以及如何接受答案。請閱讀以下內容:http://meta.stackexchange.com/questions/5234/ –

+0

好的。我錯過了這個 – user750487

回答

3

包含windows.h而不是winbase.h。

winbase.h不包含很多類似於PVOID的typedef。

+0

我需要使用MSDN代碼lke:MMFiles [wParam-IDM_MMFCREATE] .h文件不支持在windows.h中 – user750487

+1

請包括有問題的源代碼或帶有錯誤代碼示例的MSDN頁面的鏈接,我不知道你在說什麼。 – Michael

+0

對不起。我需要使用MMF接口:http://msdn.microsoft.com/en-us/library/ms810613.aspx創建MM對象,讀取,寫入... – user750487