LastErrorMessage("setPassword()"); // Format and Display GetLastError
}
return bSuccess;
}
CreateFile API here seems to always return INVALID_HANDLE_VALUE, and GetLastError reports that the operation completed successfully, but I still can't get a handle to the file.
The only thing I can think of is that another process or instance of this application already has the file open, and because you are not sharing the file this would not allow the handle to be created. Other than that, your code is correct.
Before when I call this function I am using a function to getContent() of a file. Within that function I do make sure to Close the handle to the file after reading the content into memory..
Ooh, Yes I see where its gone wrong now. I'm returning before Closing the Handle to the file. So really I should return pszFileText at the end, and obviously remove GlobalFree( pszFileText )..
Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.
This thread is more than three months old
No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.