I am using Windows 7 64-bit and Visual Studio 2008 version 9.0.21022.8.
In short, I am looking for the header "FileAPI.h". My compiler tells me "Cannot open include file: 'FileAPI.h': No such file or directory"
Is there an alternate header I can attach? Or is this file already on my system somewhere? Is this header available on the internet for free download (anyone have a link)?
I should mention I do have a line to include Windows.h, but am getting the following errors:
error C3861: '_get_osfhandle': identifier not found
error C2660: 'GetFileSize' : function does not take 1 arguments
error C2065: 'hFile' : undeclared identifier
My assumption is that these errors will be gone if I can properly include FileAPI.h
This link takes me to "GetDiskFreeSpace function" on the MSDN site. Did I miss a link somewhere for the FileAPI.h header file? Please advise. Thank you again!
FileAPI.h is a old header. It's nowhere to be found in a modern Windows SDK.
As the MSDN entries state, you should include Windows.h and let it include the other core headers.
FileAPI.h (include Windows.h);
WinBase.h on Windows Server 2008 R2, Windows 7, Windows Server 2008,
Windows Vista, Windows Server 2003, and Windows XP (include Windows.h)
Ok thank you for your help. Will strip down the headers as you indicate.
Ok as you clearly see that I include the Windows.h header. Can you help me with the following errors (note that my code is pasted above in my 2nd entry)?
error C3861: '_get_osfhandle': identifier not found
error C2660: 'GetFileSize' : function does not take 1 arguments
error C2065: 'hFile' : undeclared identifier
I was assuming that they were related to FileAPI.h (a simple fix), but now that you have shed light on the fact that they should be in Windows.h - clearly that isn't the issue.
Would you have a look at the errors and the code and let me know your thoughts on how to fix these?
(Note that when they say "applies to desktop apps only", Microsoft means normal, old-school Win32 or Win64 programs as opposed to the new Metro style apps)