News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

how to run the .chm file from the helptopic menu?

Started by Eric4ever, May 30, 2006, 09:27:06 AM

Previous topic - Next topic

Eric4ever

the title says all.

i found that some methods are like this:
  .data
calculator db "C:\WINDOWS\system32\calc.exe",0

the definetion must have absolute path, and i want to run the .chm file(the same directory as the application file) from the help topic menu, how can i do it?

thanks in advance.


Eric4ever

#2
Thanks Stan :U


Eric4ever

there is still a question.

how to convert the htmlhelp.h to htmlhelp.inc?
i tried the 'h2inc' application, but it errors at line 170...

stanhebben

I see there's a htmlhelp.inc file in the masm include files, but that one seems a bit limited.

Sec, I'll translate it manually. (only 400 lines  :wink)

Stan

stanhebben

Ok, here it is. Enjoy!

And correct my errors, if any.

Stan

[attachment deleted by admin]

Eric4ever

hi stan,

thanks your kindly help. but what's the problem?

htmlhelp.lib(init.obj) : error LNK2001: unresolved external symbol __imp__RegCloseKey@4
htmlhelp.lib(init.obj) : error LNK2001: unresolved external symbol __imp__RegQueryValueExA@24
htmlhelp.lib(init.obj) : error LNK2001: unresolved external symbol __imp__RegOpenKeyExA@20
firmware.exe : fatal error LNK1120: 3 unresolved externals
NMAKE : fatal error U1077: 'C:\WINDOWS\system32\cmd.exe' : return code '0x460'
Stop.



GregL


Eric4ever

#8
thanks Greg, it's ok, but there is still a question: how can i link to the help file in the current directory?

I define the help file liake this:

szHelpFile    db    "D:\Project\program\help.chm",0


the help menu can only be valid when the help file exists at the D:\Project\program directory. when I move the folder which contains the application and help file, the help menu is invalid. so, how can i make it move-and-run? i try to define is as:
szHelpFile    db    ".\help.chm",0

but it error..

stanhebben


Ian_B

Quote from: Eric4ever on June 02, 2006, 05:15:00 AM
thanks Greg, it's ok, but there is still a question: how can i link to the help file in the current directory?
If the help file should always be in the same folder as the running app, use:
invoke GetCurrentDirectory, (returnbufferlength), (returnbufferpointer)
Then you'll have to concatenate your "\help.chm" onto the end of whatever's returned. Make sure you check whether there's already a "\" on the end of that, I'm not sure whether the path returning API routines add it.

Ian_B

Shantanu Gadgil

Would using GetModuleFileName be a better idea? I always use that to evaluate the .ini location of my app.
To ret is human, to jmp divine!

Mark Jones

Shantanu is correct, GetCurrentDirectory does not necessarily return the directory the calling app is running from, whereas GetModuleFileName does. I found that out the hard way. :wink
"To deny our impulses... foolish; to revel in them, chaos." MCJ 2003.08

Eric4ever

local    @szBuffer[128]:byte

invoke    GetModuleFileName,NULL,addr @szFileName,MAX_PATH
......


the GetModuleFileName retrieves the full path and filename, what should I do the in the next step in order to prepare for the invoke of htmlhelp?

thanks in advance.

zooba

Include SHLWAPI include and library and use PathRemoveFileSpec(szPath) and PathCombine(szBuffer, szPath, szFile).

Cheers,

Zooba :U