I'm trying to bring a project from VC6 to VS2005 Pro. When I first imported the project there was, not unexpectedly, a long list of compiler errors and warnings, and I modified the source code to get rid of all of them, and am now left with 2 problems I'm not sure how to fix.
1) I get an error during the html help phase of compilation to the tune of "windows can't find hcw" - that's the executable for the help workshop. I see that hcw.exe was installed in the Tools/ directory of VS6, but I can't find a comparable executable anywhere in the VS2005 directories. (This problem does not stop compilation)
2) Much more disturbing than the above problem is that once the program compiles (0 errors, 0 warnings) it immediately crashes with an exception:
"Unhandled exception at 0x004354b3 in GUPIXWIN.exe: 0xC0000005: Access violation writing location 0x160295c6."
Now to be honest I'm not even sure where to start hunting for whatever is causing that second problem. I'm not even sure what information someone might need to help me diagnose this problem. Can anyone give me a hint
Nick

VC++ migration problems
ShadowD
Problem:: Compiler could not find HCW.exe.
New Compiler does not include HCW.exe. I copied it from VS-6 and put it in C:\Program Files\Microsoft Visual Studio 8\ where it could and did find it.
This is the Help Compiler Workshop, apparently not supported in VS-8.
Anders Lassen
Ken46
that is correct, the help workshop is no longer supported.
as for stdafx.h, this is not a "garbage file" introduced by the wizard. it is the pre-compiled header file. you cannot change to use a different stdafx.h, you need the one that is for your project. pre-compiled headers are a mechanism to improve build performance. you can read about them at http://msdn.microsoft.com/library/default.asp url=/library/en-us/vccore/html/_core_creating_precompiled_header_files.asp
your best bet to determine the source of the crash is to run it under the debugger. when it crashes you will break into the debugger. at that point you'll have to see if you can figure out what has gone wrong. somewhere a pointer is being used improperly, you'll need to figure out where and why.
hth,
josh
VC++ project system developer
i2adnan
kmp112495
The stdafx.h is the old one, the new one is <cstdafx> I changed all my code from the old C style headers when I was building for Win x64 and this is how I was able to get everything working faster.
eg
stdio.h -> <cstdio>
stdlib.h -> <cstdlib>
these are the way the new compilers like them best
anuppm
That link tells you how to add HTML help in what seems like a rather round-about and complex way. before I try it, can you say if it is appropriate to changing an application that was set up to use the old style context-sensitive help (which is what hcw is about, I believe)
My original app used hcw, even though I didn't actually use it to add in any help becauase the app is not in production yet. So I would be content to just remove all reference to it for now.
In other words, does anyone know a specific set of instructions for getting rid of hcw references in the compiler and then optionally adding in HTML help when desired
Steve Nesbitt
Thanks for your reply!
I've followed your advice and cranked up the warning level on the old compiler, but it didn't turn up anything pertinent. With regards to the use of new and delete as opposed to malloc, I didn't have any mallocs in the original code.
Now one thing that I haven't done is, as you say, change my headers to the new ones... it looks like the only header file that needs changing for me is stdafx.h, since all the others are accessed via #include<> (which, I think, means they should be automatically referencing the new ones). I've tried to put in the new stdafx.h that I found in C:\Program Files\Microsoft Visual Studio 8\VC\atlmfc\src\mfc, but after I put it in I get literally thousands of linker errors, such as this one:
MyDialog.obj : error LNK2001: unresolved external symbol "protected: static struct AFX_MSGMAP const * __stdcall CDialog::GetThisMessageMap(void)" ( GetThisMessageMap@CDialog@@KGPBUAFX_MSGMAP@@XZ)
So did I use the wrong stdafx.h, or are there likely more files that I need to overwrite
Nick
rfitch
OK sorry, forgot those are those garbage files VC uses, I do everything differrently, I dont use the wizards.
I have converted many programs that are c++ to the new headers and now programs run better in Win64
Still there is a lot of work migrating programs.
JaredK
I believe the recommended action is to convert your help to the new "HTMLHelp" format.
http://msdn.microsoft.com/library/default.asp url=/library/en-us/vccore/html/vcovrHelpTopicsHTMLHelpContextSensitiveHelpForYourPrograms.asp
has information about htmlhelp and Visual C++.
hth,
josh
vc++ project system developer
Ashwin Jayamohan
Hi,
I had the same problem and this is how I solved it.
It is not very smart but it works and I don't get, when building the solution, any more warnings "... hcw file does not exist ...".
First i removed the help directory from the solution explorer.
Then I closed the solution and by hand deleted hlp directory in the project.
Then I deleted .sln file.
Then I opened .vcproj file in notepad (or some other txt editor) i deleted following lines:
<File
RelativePath="hlp\FCM.hpj"
>
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCustomBuildTool"
Description="Making help file..."
CommandLine="start /wait hcw /C /E /M "hlp\$(InputName).hpj"
if errorlevel 1 goto :Error
if not exist "hlp\$(InputName).hlp" goto :Error
copy "hlp\$(InputName).hlp" "$(OutDir)"
goto :done
:Error
echo hlp\"$(InputName)".hpj(1) : error:
type "hlp\$(InputName).log"
:done
"
AdditionalDependencies="hlp\AfxCore.rtf;hlp\FCMhelp.rtf;hlp\$(TargetName).hm;"
Outputs="$(OutDir)\$(InputName).hlp"
/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCustomBuildTool"
Description="Making help file..."
CommandLine="start /wait hcw /C /E /M "hlp\$(InputName).hpj"
if errorlevel 1 goto :Error
if not exist "hlp\$(InputName).hlp" goto :Error
copy "hlp\$(InputName).hlp" "$(OutDir)"
goto :done
:Error
echo hlp\"$(InputName)".hpj(1) : error:
type "hlp\$(InputName).log"
:done
"
AdditionalDependencies="hlp\AfxCore.rtf;hlp\FCMhelp.rtf;hlp\$(TargetName).hm;"
Outputs="$(OutDir)\$(InputName).hlp"
/>
</FileConfiguration>
</File>
So find in the .vcproj the lines defining the file hlp\FCM.hpj (or how your file is called) and delete them.
Save the .vcproj file and then open it with the Visual Studio. It will create new .sln file.
Again, I now this is not the most elegant solution but for me it worked.
Cheers,
Maja
TomTX
I appreciate the suggestion, but there is no such file as cstdafx.
As it happens though, the headers were where my problem was. I'm not sure what the "correct" way to fix that problem would be, but what I did was create a sample MFC application using the application wizard, then I stole its stdafx.h & stdafx.cpp files. With those files, the project ran without any problems.
Aplus191
First, check you code carefully and you can use your old compiler, set the warning level up higher to flag more problems.
In addition, change your old headers to the new c++ ones.
Your error suggets a bad pointer. Time to check the code carefully and use c++ new and delete in place of malloc()