OK, I know this is for Visual Studio 6 but I have been able to compile CHM files from within Visual Studio for years:
https://msdn.microsoft.com/en-us/library/aa733976(v=vs.60).aspx
Now, on 2017 RC, I am having problems.
The Html Help folder is available:
So that bit is OK.
I have set the HHP file to compile to a CHM:
Yet, when I try to compile the HHP file I get this error:
1>C:\Program Files (x86)\Microsoft Visual Studio\2017rc\Community\MSBuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets(3021,7): error MSB4057: The target "CoreCompile" does not exist in the project.
I am really stumped. I have tweaked and tweaked it and I can't build my HHP file using this method. At the moment I have to manually open it using Html Help Workshop and compile it there.
What is wrong?
Update: I am trying to right click the HHP and select Compile.
Update 2: I have got the settings right now:
But, there is a gotcha. If I now try to compile the project, I get another error:
1>C:\Program Files (x86)\Microsoft Visual Studio\2017rc\Community\Common7\IDE\VC\VCTargets\Microsoft.CppCommon.targets(171,5): error MSB6006: "cmd.exe" exited with code 1.
I don't have reproduced your error because I'm always compiling outside Visual Studio (VB). I think it's the return code and totally down to hhc.exe
, nothing else.
The trick is to look at the %ERRORLEVEL%
after it runs. It returns "1" despite success. This could be used in a custom command to warn the user it's spurious, if the hhc.exe
run is isolated from other stuff. HHC.exe
is using HHA.dll
. About HHA.dll
info has not been published. Microsoft grant the HHA interface information under non-disclosure agreement (NDA) to approved help ISV's.
To go around this and continue you need to add if not %errorlevel% 1 exit /B 1
in a batch file.
For further information go deeper into following threads: