So for my Win32 app I use one
.chm file as a manual and
another .chm for representing "Version History." I use a
HtmlHelpW()
function for opening them.
The problem is, if I open both of them, the second
.chm file hangs up, starts to consume all CPU power, and after about five seconds shows the error "Not enough memory. Try to close other applications and try again."
The question is, did anyone have this issue while working with
.chm files? If so, how did you fix it?
What I have tried:
I found some info about too small stack size (1MB). I tried to increase it to 4MB and it did not change anything.
I also checked around fifteen apps and none of them seem to use multiple
.chm files. The only one that can open "multiple"
.chm files is AHK, but it's done by creating a new process for each CHM.
I know I can simply put everything into one CHM file, but I would like to know why I fail to open multiple CHM files.
Thanks to @CHill60 I could found the cause of the problem. Here is the code that shows everything:
HtmlHelpW(mainWnd, L"C:\\file1.chm", HH_DISPLAY_TOPIC, 0); HtmlHelpW(mainWnd, L"C:\\file2.chm", HH_DISPLAY_TOPIC, 0); HtmlHelpW(mainWnd, L"C:\\User guide.chm", HH_DISPLAY_TOPIC, 0);