Link to home
Start Free TrialLog in
Avatar of hansw77041
hansw77041

asked on

VS6 problem when MFC project is moved

I have a MFC project on a drive and copied it to a different dirve.

Then I renamed the original folder so there would be no chance of VS6 could reference the old drive/folders.

I then opened the project .dsw file and that seemed to go OK.

Then I did a "Clean" and Build All. Checked the time and date stamp of the new .obj and exe and it made sense.

When I start the debugger ir issued a message "One or more files are out of date or do not exist" ........ Would you like to build them?

Well the files do exist and they are new.

I checked the path in Project / Link and made sure it pointed to the new folder.
Recompiled and tried Debug again.,.. Same message.

I've moved projects before using the same procedure and never had a problem...  

What did I do wrong ?

Avatar of jkr
jkr
Flag of Germany image

Open the .dsp file in a text editor and check whether it contains any references to the old location. VC++ sometimes has the nasty habit to place absolute paths there.
Avatar of hansw77041
hansw77041

ASKER

No hard coded paths..

I noticed these items do not have any path.

# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""
# PROP Scc_LocalPath ""
Instead of clean - build how about a rebuild all.
OR Delete the DEBUG/RELEASE directory, then build.
That was the first thing I tried.  
Although I deleted the contents of Debug/Release and rebuild ALL
The new obj's and EXE appear in the folder and the EXE works... !
It's just annoying to get that message each time.

Several years ago I had something similar and used Touch to make all files have current time date and that fixed that problem then.
By deleting and ReBuild ALL they files get the current time data so using touch would not accomplish anything...


I may export a .MAK and then have VS6 make a new project file from the MAK...
Hm, open your project properties, go to the "Debug" tab and check what file is listed as "Executable for Debug session"...
This is VS6..
I went to Project / Settings /Debug tab and then refreshed the path for the executeable.

It did not help same message.

I changed configuration to Release then Clean and Rebuild ALL  and it does the same thing...
Long shot (hope I remember vc6 correctly) - does it have a help file?  If yes then check the contents of the bat file, maybe there is a hardcoded path there.
I think you mean am I using a Pre-Compile batch file as a helper .

No not on this project.

I'll try the .MAK thing tonight...
Nope - creating a .hlp file.  Maybe I remember wrong but doesn't the default behaviour involve calling a bat file of the help compiler?
If you don't have a help file then it isn't relevant at all.
Yes this project is using a 68 page help file of type ,chm

In the App::Initinstance() I do this: (can't remember where I got this code snippet)

    CString strHelpFile = m_pszHelpFilePath;
    strHelpFile.Replace(_T(".HLP"), _T(".chm"));
    free((void*)m_pszHelpFilePath);
    m_pszHelpFilePath = _tcsdup(strHelpFile);

I tried commenting out the code and it did not fix the problem,
I looked for other paths in every Project settings and everything points to the correct path.


I just tried opening the project using the .MAK and it's still the same...

ASKER CERTIFIED SOLUTION
Avatar of mahesh1402
mahesh1402
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Good one... you nailed it... one file had 29 August 2007 !
Thanks for the help
A note about my comment of using touch.... Had I done that on the source files it would have fixed the problem as it did years ago...
However my assumption was that touch would not help becasue I was doing clean and also deleting the contents of the Debug folder!
The issue was of course th date of the source...

Thanks for the help..
>>>Good one... you nailed it... one file had 29 August 2007 !


You said all you had done was copied the files AND you had checked the date/times of them in the original question.  

<Well the files do exist and they are new. >
>>Well the files do exist and they are new.

Future and New :
As i said the compiler will notice the files time are in the 'future ' and attempt to compile them regardless if they need it or not.. may be it seems he verified it its new but NOT its in 'future' as he said 'one file had 29 August 2007' which is a month later.....

-MAHESH
My first thoughts when reading the problem - time stamp in future.

I guess jkr would also think the same BUT the questioner explicitly said he checked so I didn't mention that.

:-(
thats probably cause of just 'checking Not Older'...

-MAHESH
Sometime the problem can be the person asking the question... as was the case this time.

As to the Quote about files being new:

Please quote in full context.!

Quote:
"Then I did a "Clean" and Build All. Checked the time and date stamp of the new .obj and exe and it made sense.
...
Well the files do exist and they are new. "
end Quote:

Note I did state obj and exe and NOT source... sounds stupid... OK so I made a mistake !

Anyway that statement should have been the prompt for a question such as ....  

Q) Did you check the time date stamp of the source files...?

Thanks for the help...  






I took the <Well the files do exist and they are new. > to be the source files - because that was what you were having problems with.
Ah well - it works now.
Andy,
Thanks for the help.
Yes but that was my mistake.... Using this stuff as little as I do I tend to forget things...
Had I used touch it would never have been as a question on EE!

I do appreciate your efforts and sorry I could not award points. You know the rules if someone nails it... they have to get the points...




Note that Even if you check files date & stamps you could mess with your system clock, if that wrong you will get same errors, hence I suggested above to check your system clock along with date & stamps that are not in future.

-MAHESH