Sorry, I just havent been able to get a GetLastError() function to return anything.
What do you mean "not return anything?"
if (mFd == INVALID_HANDLE_VALUE)
DWORD dwError = GetLastError();
printf("The value of the error code is %d\n", dwError);
That is all we have been waiting for all this time. What is the error value?
if ( ThisFunctionCallReturnedFailure )
DWORD dwError = GetLastError( );
// dwError now has the reason code for why the function failed
That is what your original code was missing -- you never checked at all for the reason code for the failure. All you did was check for failure, and all we asked you to do is go further and check the reason for the failure by calling GetLastError(). That doesn't sound complex to me.
I am a complete newb to programming, but unfortunately, have been handed a project that is dealing with a fairly complex program that was downloaded. So most of the code I have posted, I did not actually do. Just trying to get this program to run properly ASAP
What we asked you to do has nothing to do with the size or complexity of the program.
All we wanted was you to make a single function call, GetLastError() and see what value is returned, instead of being in the dark as to why CreateFile fails. If you can't do that, then may I suggest you get someone else to finish your program, since what we asked is the simplest of things.
Last edited by Paul McKenzie; September 9th, 2010 at 12:26 PM.