Dear DaniWeb,
I am working on a source code editor using Scintilla and am currently having some issues with the CreateFile() function. It does not return an error when I am saving as a new file, but when I am saving changes to the current file, it returns INVALID_HANDLE_VALUE. I am using the function exactly how I have used it before in other projects.
I have my own error report system setup, so I know exactly where the error is coming from. But suprisingly this does not help me very much. I have looked up the CreateFile() syntax on MSDN, and every parameter has the correct type of value. Also, my compiler does not throw an error. I am using Windows Vista.
file = CreateFile(fileName, GENERIC_WRITE, 0, 0, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0);
if (file != INVALID_HANDLE_VALUE)
Does anybody know why this line of code might be throwing INVALID_HANDLE_VALUE?