让VC不再编译帮助文件的方法

类别:VC语言 点击:0 评论:0 推荐:

让VC不再编译帮助文件的方法

 

VC帮助虽然很好,但有时很烦,每一次编译都会自动编译帮助文件,不理我们有没有修改过RTF文件,耗神又耗时间,实在让人烦。

怎么弄掉这帮助呢?上网上去问,没人回答。在Project Settings里找,也没找到。Google里搜,也没搜到。一开始我怀疑是MakeHelp.bat,还真去解决掉他,编译时也没发现什么大问题,还高兴地上了论坛发表自己的见解。但不好的是,网友demetry发短信告诉我这方法不行,他试了。真的不行,我一开始不信,明明我试了是可以的呀,怎么到他手上就不行了呢?不信他的,发信说他是不是操作错了。过了一一天,他发信来了,来了一句”你在仔细试一下。我已经试过很多次。你这个方法不行。”我仔细地试了一下,汗颜,真的不行。

仔细找了一下,项目文件里没什么特别的文件,但有一个DSP文件,用记事本打开此文件仔细看一下,发现有三个地方是用于处理帮助文件的编译的。祸根正是由这三段代码产生,下面我们一起来来铲除祸根。

祸根一、Making help file...

SOURCE=.\hlp\Test.hpj

 

!IF  "$(CFG)" == "Test - Win32 Release"

 

# PROP Ignore_Default_Tool 1

USERDEP__TEST_=hlp\AfxCore.rtf    hlp\AfxPrint.rtf      hlp\$(TargetName).hm

# Begin Custom Build - Making help file...

OutDir=.\Release

TargetName=Test

InputPath=.\hlp\Test.hpj

InputName=Test

 

"$(OutDir)\$(InputName).hlp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"

       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

      

# End Custom Build

 

!ELSEIF  "$(CFG)" == "Test - Win32 Debug"

 

# PROP Ignore_Default_Tool 1

USERDEP__TEST_=hlp\AfxCore.rtf    hlp\AfxPrint.rtf      hlp\$(TargetName).hm

# Begin Custom Build - Making help file...

OutDir=.\Debug

TargetName=Test

InputPath=.\hlp\Test.hpj

InputName=Test

 

"$(OutDir)\$(InputName).hlp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"

       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

      

# End Custom Build

 

!ENDIF

 

# End Source File

# Begin Source File

 

把此段代码用以下代码替换它,或者干脆删掉它。

SOURCE=.\hlp\Test.hpj

# End Source File

# Begin Source File

 

祸根二、Making help include file...

SOURCE=.\Resource.h

 

!IF  "$(CFG)" == "Test - Win32 Release"

 

# PROP Ignore_Default_Tool 1

# Begin Custom Build - Making help include file...

TargetName=Test

InputPath=.\Resource.h

 

"hlp\$(TargetName).hm" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"

       echo. >"hlp\$(TargetName).hm"

       echo // Commands (ID_* and IDM_*) >>"hlp\$(TargetName).hm"

       makehm ID_,HID_,0x10000 IDM_,HIDM_,0x10000 resource.h >>"hlp\$(TargetName).hm"

       echo. >>"hlp\$(TargetName).hm"

       echo // Prompts (IDP_*) >>"hlp\$(TargetName).hm"

       makehm IDP_,HIDP_,0x30000 resource.h >>"hlp\$(TargetName).hm"

       echo. >>"hlp\$(TargetName).hm"

       echo // Resources (IDR_*) >>"hlp\$(TargetName).hm"

       makehm IDR_,HIDR_,0x20000 resource.h >>"hlp\$(TargetName).hm"

       echo. >>"hlp\$(TargetName).hm"

       echo // Dialogs (IDD_*) >>"hlp\$(TargetName).hm"

       makehm IDD_,HIDD_,0x20000 resource.h >>"hlp\$(TargetName).hm"

       echo. >>"hlp\$(TargetName).hm"

       echo // Frame Controls (IDW_*) >>"hlp\$(TargetName).hm"

       makehm IDW_,HIDW_,0x50000 resource.h >>"hlp\$(TargetName).hm"

      

# End Custom Build

 

!ELSEIF  "$(CFG)" == "Test - Win32 Debug"

 

# PROP Ignore_Default_Tool 1

# Begin Custom Build - Making help include file...

TargetName=Test

InputPath=.\Resource.h

 

"hlp\$(TargetName).hm" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"

       echo. >"hlp\$(TargetName).hm"

       echo // Commands (ID_* and IDM_*) >>"hlp\$(TargetName).hm"

       makehm ID_,HID_,0x10000 IDM_,HIDM_,0x10000 resource.h >>"hlp\$(TargetName).hm"

       echo. >>"hlp\$(TargetName).hm"

       echo // Prompts (IDP_*) >>"hlp\$(TargetName).hm"

       makehm IDP_,HIDP_,0x30000 resource.h >>"hlp\$(TargetName).hm"

       echo. >>"hlp\$(TargetName).hm"

       echo // Resources (IDR_*) >>"hlp\$(TargetName).hm"

       makehm IDR_,HIDR_,0x20000 resource.h >>"hlp\$(TargetName).hm"

       echo. >>"hlp\$(TargetName).hm"

       echo // Dialogs (IDD_*) >>"hlp\$(TargetName).hm"

       makehm IDD_,HIDD_,0x20000 resource.h >>"hlp\$(TargetName).hm"

       echo. >>"hlp\$(TargetName).hm"

       echo // Frame Controls (IDW_*) >>"hlp\$(TargetName).hm"

       makehm IDW_,HIDW_,0x50000 resource.h >>"hlp\$(TargetName).hm"

      

# End Custom Build

 

!ENDIF

 

# End Source File

# Begin Source File

把上面这段代码用以下内容替换它,千万别删了。

SOURCE=.\Resource.h

# End Source File

# Begin Source File

 

祸根三、Copying contents file...

SOURCE=.\hlp\Test.cnt

 

!IF  "$(CFG)" == "Test - Win32 Release"

 

# PROP Ignore_Default_Tool 1

# Begin Custom Build - Copying contents file...

OutDir=.\Release

InputPath=.\hlp\Test.cnt

InputName=Test

 

"$(OutDir)\$(InputName).cnt" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"

       copy "hlp\$(InputName).cnt" $(OutDir)

 

# End Custom Build

 

!ELSEIF  "$(CFG)" == "Test - Win32 Debug"

 

# PROP Ignore_Default_Tool 1

# Begin Custom Build - Copying contents file...

OutDir=.\Debug

InputPath=.\hlp\Test.cnt

InputName=Test

 

"$(OutDir)\$(InputName).cnt" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"

       copy "hlp\$(InputName).cnt" $(OutDir)

 

# End Custom Build

 

!ENDIF

 

# End Source File

# End Group

# Begin Source File

把上面这段代码用以下内容替换它,最好别删了。

SOURCE=.\hlp\Test.cnt

# End Source File

# End Group

# Begin Source File

 

好了,解决了,世界又恢复了清净。

在此也谢谢demetry,如何没有他的细心,可能我一直还以为自己已经解决了这问题呢。

本文地址:http://com.8s8s.com/it/it1968.htm