There are two ways to implement visual Help in an application. You can associate a help topic or index with an application using the IfmManage::put_HelpContext method, or you can associate a help topic or index with a form using the IASForm::put_HelpContext method. The two put_HelpContext methods use the same parameters.
The following code example shows the syntax for calling a visual Help index or topic file.
put_HelpContext(bstrIndexFile, bstrTopicFile);
When you call put_HelpContext, the Forms Manager automatically handles the VK_HELP event.
The following code example shows how to set up a Help context with a Help index file by calling put_HelpContext. Again, check the memory allocation return value to ensure it did not fail.
BSTR bstrIndexFile = SysAllocString(L"\\path\\help-index.html");
pManage->put_HelpContext(bstrIndexFile, NULL);
SysFreeString(bstrIndexFile);
SysAllocString returns NULL if there is insufficient memory.
The following code example shows how to set up a Help context with a Help topic file by calling put_HelpContext. Again, check the memory allocation return value to ensure it did not fail.
BSTR bstrTopicFile = SysAllocString(L"\\path\\help-topic.html");
pManage->put_HelpContext(NULL, bstrTopicFile);
SysFreeString(bstrTopicFile);