# 'The system cannot find the file specified.'

This topic is 5014 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Alright guys... I keep getting this error in GetLastError():
failed with error 2: The system cannot find the file specified.
But... I am not loading any files... So I un-did what I last typed... thinking that would fix it... nadda. So I commented out code and retried... no dice. Finally I 'nuked' my coding (commented out everything BUT the error retrieval code... so all there is in _tWinMain() is that)... again same error... And this was with no coding but the error retrieval! So i started a blank project... it's in that project, too. Then I used just DWORD dw = GetLastError()... still there... It makes no sense. One thing to note, that when I run this program in LTProf, all of my compiles want to link to some library(s) at "f:\vs70builds\3077\vc\crtbld\crt\src\" (and I do not have a F drive nor any folder that would look remotely like that). Do I have to reinstall VS? [Edited by - pDK on June 30, 2005 1:50:34 AM]

##### Share on other sites
No clue, but I've got a tip for you... it's spelled "commented", not "committed". 'Comments' are bits the compiler ignores, or remarks made outside the conversation's vein. If something is 'committed', it is dedicated to some purpose.

##### Share on other sites
You're right... but this was after a 22 hour crunch time :) (Don't beleive me? check my profile on the times I posted on this forum...)

I'm still having issues... I moved from my desktop to my laptop that has a clean build to see if that would work... still nothing.

I have limited it down to one line of code as well:
hDML = LoadLibrary("DML.dll");

this ussualy returns error 0x00000006 (aka: 'The handle is invalid.')

So... any other help (besides on my english [smile])?

##### Share on other sites
Quote:
 Original post by pDKhDML = LoadLibrary("DML.dll");

Only time I recall DML as a dll had to do with SQL possibly of Oracle origins.

##### Share on other sites
This is something totaly different. Nothing to do with SQL nor Oracle. It is my own library.

##### Share on other sites
Have you tried "SetLastError (0)" at the start of your program? When I set a watch for "err,hr" in the debugger (which shows the text of the error message represented by GetLastError), it usually shows the "file not found" message. Seems to be a very common state for this to be in. In other words: it may have nothing to do with your program.

##### Share on other sites
Quote:
 Original post by Kippesoep[..] a watch for "err,hr" in the debugger (which shows the text of the error message represented by GetLastError) [..]
Hey, thanks for sharing this :)

##### Share on other sites
That is what I did... and the errors then propagated off of it.

Right now, I am reinstalling VS and most of my SDKs... It is one thing for this bug to corrupt one build... but it is another to corrupt every build after (new and stable).

##### Share on other sites
But what exactly is wrong with your app? In what way is it not working correctly other than calling getLastError returns non zero?

GetLastError is only usefull immdiatly after a call to an WinAPI function that supports GetLastError.

Its job is to tell you more information AFTER a function returns a fail code. Its not a general well-being monitor.

##### Share on other sites
You are correct.

I do not have the exact list of errors that came up that initiated this problem (one was 14xx... something about no (DC)). But my program would not alloc any memory... nor free any for that matter. It would not register my windows' classes... and nor would it create any windows either. It was a mess.

But I just reinstalled VS, so I am going to try a stab at it again.

• ### What is your GameDev Story?

In 2019 we are celebrating 20 years of GameDev.net! Share your GameDev Story with us.

• 10
• 24
• 15
• 38
• ### Forum Statistics

• Total Topics
634828
• Total Posts
3019486
×