2014-04-21 4 views
1

내 VB6 응용 프로그램 용 .CHM 도움말 파일이 있습니다. 프로젝트 속성에 지정된 도움말 파일 위치에서 런타임에 위치를 변경해야합니다. HTML 도움말의 일부 양식을 사용하고 싶지 않습니다. 프로그램이 .CHM 도움말 파일을 찾는 위치를 변경하는 방법을 알아야합니다.런타임시 .chm 파일의 위치를 ​​변경하는 방법

누구든지이 문제에 착수 했습니까?

응용 프로그램을 실행하는 개별 컴퓨터가 아니라 데이터 파일이있는 서버에 도움말 파일을 저장하려고합니다.

+0

앱 개체에 설정합니다. –

답변

3

는 아래와 같이 App 개체의 도움말 파일 속성을 설정합니다

App.HelpFile = g_Path_to_Your_CHM & "\YourHelpFile.chm" 
0

서버에 CHM 몇 가지 보안 문제가 있습니다!

:
Public Function HFile(ByVal i_HFile As Integer) As String 
'----- Set the string variable to include the application path of helpfile 
Select Case i_HFile 
Case 1 
HFile = App.Path & "\help\CHM-example.chm" 
Case 2 
'----- Place other Help file paths in successive case statements 
HFile = App.Path & "\help\CHM-other-language.chm" 
End Select 
End Function 

이 모든

이 모듈이 추가됩니다 그것은에 의해라고

Public Sub ShowContents(ByVal intHelpFile As Integer) 
HtmlHelp hwnd, HFile(intHelpFile), HH_DISPLAY_TOC, 0 
End Sub 

: 넝마 외에도

는이 같은 도움말 파일을 호출 할 수 있습니다 위의 답변

 
'****************************************************************************** 
'----- Modul - definition for HTMLHelp - (c) Ulrich Kulle, www.help-info.de 
'----- 2002-08-26 Version 1.0 first release 
'----- 2005-07-17 Version 1.1 updated for Pop-Up help 
'****************************************************************************** 
'----- Portions of this code courtesy of David Liske. 
'----- Thanks to David Liske, Don Lammers, Matthew Brown and Thomas Schulz 
'------------------------------------------------------------------------------ 
Type HH_IDPAIR 
    dwControlId As Long 
    dwTopicId As Long 
End Type 

'This array should contain the number of controls that have 
'context-sensitive help, plus one more for a zero-terminating 
'pair. 

Public ids(2) As HH_IDPAIR 

Declare Function GetDlgCtrlID Lib "user32" _ 
    (ByVal hwnd As Long) As Long 

Public Declare Function HtmlHelp Lib "hhctrl.ocx" Alias "HtmlHelpA" _ 
       (ByVal hwndCaller As Long, ByVal pszFile As String, _ 
       ByVal uCommand As Long, ByVal dwData As Long) As Long 

Declare Function HTMLHelpTopic Lib "hhctrl.ocx" Alias "HtmlHelpA" _ 
       (ByVal hwndCaller As Long, ByVal pszFile As String, _ 
       ByVal uCommand As Long, ByVal dwData As String) As Long 

Private Declare Function HtmlHelpSearch Lib "hhctrl.ocx" Alias "HtmlHelpA" _ 
       (ByVal hwndCaller As Long, ByVal pszFile As String, _ 
       ByVal uCommand As Long, dwData As HH_FTS_QUERY) As Long 


Public Const HH_DISPLAY_TOPIC = &H0   ' select last opened tab, [display a specified topic] 
Public Const HH_DISPLAY_TOC = &H1   ' select contents tab, [display a specified topic] 
Public Const HH_DISPLAY_INDEX = &H2   ' select index tab and searches for a keyword 
Public Const HH_DISPLAY_SEARCH = &H3  ' select search tab and perform a search 

Private Const HH_SET_WIN_TYPE = &H4 
Private Const HH_GET_WIN_TYPE = &H5 
Private Const HH_GET_WIN_HANDLE = &H6 
Private Const HH_DISPLAY_TEXT_POPUP = &HE ' Display string resource ID or 

Public Const HH_HELP_CONTEXT = &HF   ' display mapped numeric value in dwData 

Private Const HH_TP_HELP_CONTEXTMENU = &H10 ' Text pop-up help, similar to WinHelp's HELP_CONTEXTMENU. 
Private Const HH_TP_HELP_WM_HELP = &H11  ' text pop-up help, similar to WinHelp's HELP_WM_HELP. 


Public Type HH_FTS_QUERY    ' UDT for accessing the Search tab 
    cbStruct   As Long    ' Sizeof structure in bytes. 
    fUniCodeStrings As Long    ' TRUE if all strings are unicode. 
    pszSearchQuery As String   ' String containing the search query. 
    iProximity  As Long    ' Word proximity. 
    fStemmedSearch As Long    ' TRUE for StemmedSearch only. 
    fTitleOnly  As Long    ' TRUE for Title search only. 
    fExecute   As Long    ' TRUE to initiate the search. 
    pszWindow   As String   ' Window to display in 
End Type 

Public Function HFile(ByVal i_HFile As Integer) As String 
'----- Set the string variable to include the application path of helpfile 
    Select Case i_HFile 
    Case 1 
    HFile = App.Path & "\help\CHM-example.chm" 
    Case 2 
'----- Place other Help file paths in successive case statements 
    HFile = App.Path & "\help\CHM-other-language.chm" 
    End Select 
End Function 

Public Sub ShowContents(ByVal intHelpFile As Integer) 
    HtmlHelp hwnd, HFile(intHelpFile), HH_DISPLAY_TOC, 0 
End Sub 

Public Sub ShowIndex(ByVal intHelpFile As Integer) 
    HtmlHelp hwnd, HFile(intHelpFile), HH_DISPLAY_INDEX, 0 
End Sub 

Public Sub ShowTopic(ByVal intHelpFile As Integer, strTopic As String) 
    HTMLHelpTopic hwnd, HFile(intHelpFile), HH_DISPLAY_TOPIC, strTopic 
End Sub 

Public Sub ShowTopicID(ByVal intHelpFile As Integer, IdTopic As Long) 
    HtmlHelp hwnd, HFile(intHelpFile), HH_HELP_CONTEXT, IdTopic 
End Sub 
'------------------------------------------------------------------------------ 
'----- display the search tab 
'----- bug: start searching with a string dosn't work 
'------------------------------------------------------------------------------ 
Public Sub ShowSearch(ByVal intHelpFile As Integer) 
Dim searchIt As HH_FTS_QUERY 
    With searchIt 
    .cbStruct = Len(searchIt) 
    .fUniCodeStrings = 1& 
    .pszSearchQuery = "foobar" 
    .iProximity = 0& 
    .fStemmedSearch = 0& 
    .fTitleOnly = 1& 
    .fExecute = 1& 
    .pszWindow = "" 
    End With 
    Call HtmlHelpSearch(0&, HFile(intHelpFile), HH_DISPLAY_SEARCH, searchIt) 
End Sub