Click here to Skip to main content
16,014,650 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Generala question about HtmlHelp Pin
lucy28-May-02 5:21
lucy28-May-02 5:21 
GeneralRe: a question about HtmlHelp Pin
Tim Smith28-May-02 6:05
Tim Smith28-May-02 6:05 
GeneralRe: a question about HtmlHelp Pin
lucy28-May-02 6:07
lucy28-May-02 6:07 
GeneralRe: a question about HtmlHelp Pin
Tomasz Sowinski28-May-02 8:07
Tomasz Sowinski28-May-02 8:07 
GeneralRe: a question about HtmlHelp Pin
lucy28-May-02 8:23
lucy28-May-02 8:23 
GeneralRe: a question about HtmlHelp Pin
Tomasz Sowinski28-May-02 8:21
Tomasz Sowinski28-May-02 8:21 
GeneralRe: a question about HtmlHelp Pin
lucy28-May-02 9:53
lucy28-May-02 9:53 
GeneralRe: a question about HtmlHelp Pin
Tim Smith28-May-02 10:17
Tim Smith28-May-02 10:17 
Here is the code I use. It is a subroutine.

// @cmember Get help file name from instance

static void GetHtmlHelpFileName (HINSTANCE hInstance,
    LPTSTR pszHelpFile, int nMaxChar)
{

    //
    // Get the module name
    //

    TCHAR szBuff [_MAX_PATH];
    ::GetModuleFileName (hInstance, szBuff, _MAX_PATH);

    //
    // Remove extension
    //

    LPTSTR pszExt = _tcsrchr (szBuff, '.');
    _ASSERTE (pszExt != NULL);
    _ASSERTE (*pszExt == '.');
    *pszExt = 0;

    //
    // Add extension
    //

    _tcscat (pszExt, _T (".chm"));

    //
    // Copy to destination
    //

    _tcsncpy (pszHelpFile, szBuff, nMaxChar);
    pszHelpFile [nMaxChar - 1] = 0;
    return;
}


Given the HINSTANCE (NULL for main image), it will fill the string with a help file name by replacing the extension with ".chm".


Tim Smith

I know what you're thinking punk, you're thinking did he spell check this document? Well, to tell you the truth I kinda forgot myself in all this excitement. But being this here's CodeProject, the most powerful forums in the world and would blow your head clean off, you've got to ask yourself one question, Do I feel lucky? Well do ya punk?
GeneralRe: a question about HtmlHelp Pin
Tomasz Sowinski28-May-02 11:05
Tomasz Sowinski28-May-02 11:05 
GeneralRe: a question about HtmlHelp Pin
lucy28-May-02 12:02
lucy28-May-02 12:02 
GeneralWOW I never thought... Pin
Abin28-May-02 20:38
Abin28-May-02 20:38 
GeneralRe: WOW I never thought... Pin
lucy29-May-02 3:01
lucy29-May-02 3:01 
Generaldialog window doesn't show contents Pin
28-May-02 5:13
suss28-May-02 5:13 
GeneralRe: dialog window doesn't show contents Pin
Ed Gadziemski30-May-02 12:41
professionalEd Gadziemski30-May-02 12:41 
GeneralDebug Symbols Pin
28-May-02 5:06
suss28-May-02 5:06 
QuestionHow do i round a number to the nearest integer? Pin
redeemer28-May-02 4:39
redeemer28-May-02 4:39 
AnswerRe: How do i round a number to the nearest integer? Pin
_Magnus_28-May-02 4:56
_Magnus_28-May-02 4:56 
AnswerRe: How do i round a number to the nearest integer? Pin
Prem Kumar28-May-02 4:57
Prem Kumar28-May-02 4:57 
AnswerRe: How do i round a number to the nearest integer? Pin
Rick York28-May-02 8:32
mveRick York28-May-02 8:32 
QuestionHow to get context Cmenu AND mouse move info? Pin
Pierre Couderc28-May-02 4:30
Pierre Couderc28-May-02 4:30 
GeneralGetCommMask failure. Pin
dejan.n28-May-02 4:10
dejan.n28-May-02 4:10 
GeneralRe: GetCommMask failure. Pin
Ernest Laurentin28-May-02 5:39
Ernest Laurentin28-May-02 5:39 
GeneralRe: GetCommMask failure. Pin
dejan.n4-Jun-02 21:57
dejan.n4-Jun-02 21:57 
QuestionUSB Communication? Pin
User 665828-May-02 4:00
User 665828-May-02 4:00 
AnswerRe: USB Communication? Pin
Zizilamoroso28-May-02 4:10
Zizilamoroso28-May-02 4:10 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.