|
can u give me the code to use shellexecute to call a help file(.hlp).i have created the help using visual studios help workshop and NOT HTML HELP WORKSHOP. i think both r different. so please help me in this regard. also if there is any other code that can be used to call the help file pls let me know.
Thanks
|
|
|
|
|
Hi
Please search on MSDN help about ShellExecuteEx
KK
|
|
|
|
|
Hi,
why dnt u try MSDN ?? u will find lots of examples there.
|
|
|
|
|
|
i tried but i dint get anything. under which topic is it given? the contents in msdn aren't clear
|
|
|
|
|
Hope this will help u.
You must modify the .hpj file to correct any file paths that are now invalid. You may also modify the custom build step to provide more informative error reporting.
To modify the .hpj file:
1. Open the .hpj file in Visual C++.
2. Examine its [FILES] and [MAP] sections for hard-coded paths. Modify them as necessary. Notice that the default installation path for Visual C++ 6.0 is as follows: \Program Files\Microsoft Visual Studio\VC98 whereas the default path for Visual C++ 5.0 is as follows: \Program Files\DevStudio\VC
To upgrade the custom build step rule:
1. Right-click the .hpj file in FileView; then click Settings on the Context menu, and click the Custom Build tab in the Project Settings dialog box.
2. Visual C++ 5.0 uses the following custom build step command to build help files:
call "$(ProjDir)\makehelp.bat"
Modify this text in the Commands list box to the following, assuming Makehelp.bat has not been changed from its original form:
start /wait hcw /C /E /M "hlp\$(InputName).hpj"
if errorlevel 1 goto :Error
if not exist "hlp\$(InputName).hlp" goto :Error
copy "hlp\$(InputName).hlp" $(OutDir)
goto :Done
:Error
echo hlp\$(InputName).hpj(1) : error:
type "hlp\$(InputName).log"
:Done
NOTE: The above steps are the default for a new project in Visual C++ 6.0.
3. Delete Makehelp.bat from the project; it is normally in the Help Files folder. If desired, you may also delete the Makehelp.bat file as well.
Back to the top Back to the top
STATUS
|
|
|
|
|
Visit this address it will also help u wotking with Help files
http://www.informit.com/library/content.asp?b=Visual_C_PlusPlus&seqNum=286&rl=1
|
|
|
|
|
if the help file is compiled as HTML then use the Win32 API HtmlHelp .
else you can write like this.
CString strDefaultDir;
strDefaultDir=AfxGetApp()->m_pszHelpFilePath ;
strDefaultDir.Replace(_T("TestApp.CHM"), _T(""));
SetCurrentDirectory(strDefaultDir);
ShellExecute(NULL,"open", "TestAppHelp.txt", NULL, NULL, SW_MAXIMIZE );
where TestApp is the application name and TestAppHelp is the help file name.
Hope this helps.
Appu..
"If you judge people, you have no time to love them."
|
|
|
|
|
i have created the help file using help workshop and not html help workshop. help workshop has generated a .cnt file . By combinig rtf file and cnt file i got a .hlp file. Now i want to display this .hlp file when help button is clicked or "f1" is pressed.
i added your code but nothing is being displayed. what is .CHM and where is the .TXT file created. i dont have these two files. Please help me solve this problem
Thank You
|
|
|
|
|
like this
::ShellExecute(NULL,"open","iexplore.exe","c:\\1.htm",NULL,SW_SHOWNORMAL);
whitesky
|
|
|
|
|
i dont have any htm files!!
|
|
|
|
|
I have a problem like your.
I solved it with this corrections:
Add the macros
ON_COMMAND(ID_HELP_FINDER, CMDIFrameWnd::OnHelpFinder)<br />
ON_COMMAND(ID_DEFAULT_HELP, CMDIFrameWnd::OnHelpFinder)<br />
ON_COMMAND(ID_HELP, CMDIFrameWnd::OnHelp)<br />
ON_COMMAND(ID_CONTEXT_HELP, CMDIFrameWnd::OnContextHelp)
to the Mainframe map
And add to the constructor of the application
EnableHtmlHelp();
Then put the help file in the exe folder.
Note. my help is an html help.
|
|
|
|
|
should i add these code as it is or any changes should be made. what do u mean by "mainframe map"
|
|
|
|
|
Sorry for the late:
As I sad: I solved the problem with this lines, now pressing F1 the help will be displayed.
mainframe is described in MainFrm.cpp
and there you can find the message map:
BEGIN_MESSAGE_MAP(CMainFrame, CMDIFrameWnd)
ON_WM_CREATE()
ON_COMMAND(ID_WINDOW_NEW, OnWindowNew)
... //Add here
The app constructor is (usually empty) in another file: MyAppName.cpp
But note: this works with html help, but I think that the macros are the same in both cases
|
|
|
|
|
I want hand cursor on static box. I have used the following code, but its not working please tell me if there is a way out.
CString windir;
GetWindowsDirectory(windir.GetBuffer(MAX_PATH), MAX_PATH);
windir.ReleaseBuffer();
windir += _T("\\winhlp32.exe");
HMODULE hModule = LoadLibrary(windir);
if (hModule)
{
g_hCursorLink =CopyCursor(::LoadCursor(hModule, MAKEINTRESOURCE(106)));
}
FreeLibrary(hModule);
if (g_hCursorLink)
{
m_MyStatic.SetCursor(g_hCursorLink);
}
|
|
|
|
|
The code is a little bit terrifying
Because if you just want to load the hand cursor, you will get it by
LoadCursor( 0, MAKEINTRESOURCE(32649))
Another thing is SetCursor will not change the cursor permanently.
Try this
BOOL MainWindow::OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message)
{
if( pWnd == &m_MyStatic )
{
SetCursor( LoadCursor( 0, MAKEINTRESOURCE(32649) ) );
return TRUE;
}
return CWnd::OnSetCursor(pWnd, nHitTest, message);
}
CWnd should be replaced by your class name.
- NS -
|
|
|
|
|
|
It needs (WINVER >= 0x0500). So I just used its value!
- NS -
|
|
|
|
|
NS17 wrote: It needs (WINVER >= 0x0500). So I just used its value!
So which one is easy! Using it's value (Of course with MAKEINTRESOURCE ) or defining WINVER once and using IDC_HAND .;)
Nibu thomas
Software Developer
Faqs by Michael dunn
|
|
|
|
|
OK OK...
As he was trying to load it from exe module, I think it is better to get him the cursor with out making him much effort... After he can do it successfully he can simply change it by definging the WINVER. If you don't like it, he have to ...
- NS -
|
|
|
|
|
NS17 wrote: OK OK...
As he was trying to load it from exe module, I think it is better to get him the cursor with out making him much effort... After he can do it successfully he can simply change it by definging the WINVER. If you don't like it, he have to ...
But still tell me which one is easy...
Nibu thomas
Software Developer
Faqs by Michael dunn
|
|
|
|
|
For a beginner my method is easy...
- NS -
|
|
|
|
|
NS17 wrote: For a beginner my method is easy...
What if the Beginner would like to write the same code at several places.
Nibu thomas
Software Developer
Faqs by Michael dunn
|
|
|
|
|
Nibu thomas wrote: like to write the same code at several places
But his question or need does not mean that
- NS -
|
|
|
|
|
Hi,
can somebody tell me how to create external ActiveX from Application type - Multiple documents ?
jan
|
|
|
|