|
To open a help (chm) file i use below function
ShellExecute(this->m_hWnd,_T("open"),_T("HelpSample.chm"),NULL,NULL,SW_SHOW);
and it works. But when i want to open any particular page of chm file using below function it does not work
ShellExecute(this->m_hWnd,_T("open"),_T("HelpSample.chm::/page1.html"),NULL,NULL,SW_SHOW);
Please suggest how to open any page
|
|
|
|
|
MKC002 wrote: ShellExecute(this->m_hWnd,_T("open"),_T("HelpSample.chm::/page1.html"),NULL,NULL,SW_SHOW);
Have you tried:
ShellExecute(this->m_hWnd, _T("open"), "hh.exe", _T("HelpSample.chm::/page1.html"), NULL, SW_SHOW);
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Some people are making such thorough preparation for rainy days that they aren't enjoying today's sunshine." - William Feather
|
|
|
|
|
Shouldn't be also _T("hh.exe") ?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
I'm not sure if ShellExecute() "open" will do that for you like that.
You could try something like
CreateProcess("hh.exe", " drive:\\path\\HelpSample.chm::/page1.html", ...);
*edit* or try David's method above
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
If this is a help (chm) file you have created yourself, you can open any page by using the topic ID stored for that page, using function HtmlHelp().
|
|
|
|
|
This will work,
::HtmlHelp(NULL, _T("HelpSample.chm::/html/page1.html"), HH_DISPLAY_TOPIC, 0);
http://www.mono-project.com/Main_Page
|
|
|
|
|
In a list control , which is message to edit an item , like in list-control of Windows Explorer ? It's an second click , but is not double-click ... if you know what I mean ...
Thanks.
P.S. Actually , I have edit procedure on dblclick event , but this one I need to use on something else.
|
|
|
|
|
I am not sure exactly what your question is, as it is not very clear, but this[^] may be what you are looking for.
The best things in life are not things.
|
|
|
|
|
if I've perceived right, for the functionality you're expecting the list control should have the LVS_EDITLABELS list control style set. And parent window of the list control should handle LVN_ENDLABELEDIT message.
|
|
|
|
|
i think you are talking about the following situation.when we want to rename an icon in explorer we will click the item first and after a while we will click it again to rename it.is this is you are talking about?.
http://www.mono-project.com/Main_Page
|
|
|
|
|
I was talking about listcontrol behaviuour with LVS_EDITLABELS style ... I was though is there a specific windows message for that behaviour . Thank you all , guys ! You are great ! It'a always to talk with you . Best wishes !
|
|
|
|
|
While going from Paused to Stopped the Service Status Hangs at Stopping, eventually timing out and receiving an error message.
Error 1053: The service did not respond to the start or control request in a timely fashion.
Following code is causing the service to go into not responding state when going from paused to Stopped state.
Can anyone plz help me in finding out whats wrong with the code?
When I use SERVICE_CONTROL_STOP instead of SERVICE_STOP_PENDING in the method SendStatusToSCM, it resolves the issue. Is this correct way?
VOID Handler (DWORD controlCode)
{
DWORD currentState = 0;
BOOL success;
switch(controlCode)
{
// Stop the service
case SERVICE_CONTROL_STOP:
{
success = SendStatusToSCM(SERVICE_STOP_PENDING,
NO_ERROR, 0, 1, 5000);
}
break;
// Pause the service
case SERVICE_CONTROL_PAUSE:
if (runningService && !pauseService)
{
// Tell the SCM what's happening
success = SendStatusToSCM(
SERVICE_PAUSE_PENDING,
NO_ERROR, 0, 1, 1000);
pauseService = TRUE;
SuspendThread(threadHandle);
currentState = SERVICE_PAUSED;
}
break;
}
BOOL SendStatusToSCM (DWORD dwCurrentState,
DWORD dwWin32ExitCode,
DWORD dwServiceSpecificExitCode,
DWORD dwCheckPoint,
DWORD dwWaitHint)
{
BOOL success;
SERVICE_STATUS serviceStatus;
// Fill in all of the SERVICE_STATUS fields
serviceStatus.dwServiceType = SERVICE_WIN32_OWN_PROCESS;
serviceStatus.dwCurrentState = dwCurrentState;
// If in the process of doing something, then accept
// no control events, else accept anything
if (dwCurrentState == SERVICE_START_PENDING)
serviceStatus.dwControlsAccepted = 0;
else
serviceStatus.dwControlsAccepted =
SERVICE_ACCEPT_STOP |
SERVICE_ACCEPT_PAUSE_CONTINUE |
SERVICE_ACCEPT_SHUTDOWN;
// if a specific exit code is defined, set up
// the win32 exit code properly
if (dwServiceSpecificExitCode == 0)
serviceStatus.dwWin32ExitCode = dwWin32ExitCode;
else
serviceStatus.dwWin32ExitCode =
ERROR_SERVICE_SPECIFIC_ERROR;
serviceStatus.dwServiceSpecificExitCode =
dwServiceSpecificExitCode;
serviceStatus.dwCheckPoint = dwCheckPoint;
serviceStatus.dwWaitHint = dwWaitHint;
// Pass the status record to the SCM
success = SetServiceStatus (serviceStatusHandle,
&serviceStatus);
return success;
}
|
|
|
|
|
When you change your service status from pause to stop, does your service main function really changing the state or exiting ?
|
|
|
|
|
I'm not even going to bother trying to read that unformatted code, but have you debugged it in the debugger? You can attach to service processes and step through and use breakpoints...
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
SunilKrSingh wrote: When I use SERVICE_CONTROL_STOP instead of SERVICE_STOP_PENDING in the method
SendStatusToSCM, it resolves the issue. Is this correct way?
No.
Those two values are intended for different usages. I am not sure how you decided they were equivalent.
You use SERVICE_STOP_PENDING, while you are doing work to stop a service. Such as if you have a thread that you must wait to complet. You need to use the value SERVICE_STOPPED when the service is stopped. Just before you exit.
And the reason it appears to work is because SERVICE_CONTROL_STOP and SERVICE_STOPPED both resolve to the same integer value.
|
|
|
|
|
I got the root cause of the issue.
Pausing the service is causing the service thread to be suspended with the statement SuspendThread(threadHandle);
So an attempt to stop the service from a paused state with SERVICE_STOP_PENDING was failing with error
Error 1053: The service did not respond to the start or control request in a timely fashion.
I had to resume the service thread before the stopping the service.
Thanks, Sunil
|
|
|
|
|
Is it possible to change linked-text color for CRichEditCtrl?
.
|
|
|
|
|
Hello,
Get this CRichEditCtrl in CDC, then use SetTextColor to set the color of the text.
Search in MSDN for reference.
Regards,
A. Gopinath.
|
|
|
|
|
Hi,
I am having the follwoing CString "0000122334" and I need to remove the starting zeros from the string.
Kindly help.
Thanks in Advance.
|
|
|
|
|
TrimLeft("0");
call this CString member function.
|
|
|
|
|
Just a sidenote to what Prasann Mayekar said: if your string contains only zeroes, "0000", trimming it will result in an empty string, also, if you can have fractions, like "0.45", then trimming will result in ".45".
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> //TODO: Implement signature here<
|
|
|
|
|
There can be various ways of doing this:
1. Use the Replace method from the CString class
2. Iterate through the characters in the string, until you get a non zero element. Store the index here and use the TrimXYZ function from the CString class.
You talk about Being HUMAN. I have it in my name
AnsHUMAN
|
|
|
|
|
I have an application that upon startup does an automatic software update. It checks a folder if it contains any files, and if found, copies those files over to their respective target folders.
Now suddenly this updating does not work anymore. It copies the file to the target folder, but the result is not a file in the target folder, but a sub folder with it's name as the source file's name.
Ex.
I have a file in my upgrade folder:
C:\Program\Upg\Logo.jpg
This file needs to be copied to
C:\Program
So my program does
CopyFile(strSource, strTarget, FALSE)
with
strSource = "C:\\Program\\Upg\\Logo.jpg"
strTarget = "C:\\Program\\Logo.jpg"
After the copy I end up with a sub-folder in C:\Program called Logo.jpg\ which is empty, instead of a file called Logo.jpg in C:\Program
I then hard coded the paths like:
CopyFile("C:\\Program\\Upg\\Logo.jpg", "C:\\Program\\Logo.jpg", FALSE);
but it does exactly the same
I then made an empty new console application with the hard coded CopyFile call as above and it works fine, ie. Logo.jpg is copied from the Upg folder to C:\Program
I tried playing with the project settings, stack/heap sizes, etc, but my application does not copy the file !
Any ideas ?
|
|
|
|
|
is your CopyFile return true or false?? If false than use GetLastError() to check the error information.
"Every Little Smile can touch Somebody's Heart...
May we find Hundreds of Reasons to Smile Everyday... and
May WE be the Reason for someone else to smile always!" (ICAN)
"Your thoughts are the architects of your destiny."
|
|
|
|
|
It sometimes returns TRUE , but still copies the file into the empty sub-folder
It sometimes returns FALSE, but still copies the file into the empty sub-folder, GetLastError then returns 5
|
|
|
|