|
I don't think you are supposed to do it this way. See this MSDN link[^] for details of the HtmlHelp API call. The added benfit of this is that when the application that displayed the help closes, the help file itself also closes automatically.
|
|
|
|
|
Graham Bradshaw wrote:
The added benfit of this is that when the application that displayed the help closes, the help file itself also closes automatically.
Benefit?! Personally, I hate this "feature"
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
I know that crappy HtmlHelp API function. I will definitively not use this; if the WinExec call wouldn't work the users would have bad luck and no help Fortunately the WinExec method works... I was just wondering why the CreateProcess doesn't work...
Best regards
Dominik
_outp(0x64, 0xAD);
and
__asm mov al, 0xAD __asm out 0x64, al
do the same... but what do they do??
(doesn't work on NT)
|
|
|
|
|
Dominik Reichl wrote:
Hm.. Ok, now the hh.exe starts at least... Hh.exe is in my Windows directory, will it always be there? (under WinNT in WinNT directory?) Even if using the GetWindowsDirectory function, it's a dangerous assumption...
Agreed. You need to follow the same rules as WinExec.
The directory from which the application loaded.
The current directory.
The Windows system directory. TheGetSystemDirectory function retrieves the path of this directory.
The Windows directory. TheGetWindowsDirectory function retrieves the path of this directory.
The directories listed in the PATH environment variable.
Dominik Reichl wrote:
But now I get an error from the hh.exe: no command line was specified?!??!
Does it work if you specify just the filename?
Neville Franks, Author of ED for Windows www.getsoft.com and Surfulater www.surfulater.com "Save what you Surf"
|
|
|
|
|
Neville Franks wrote:
Does it work if you specify just the filename?
No, it doesn't. Exactly the same message appears.
Thanks and best regards
Dominik
_outp(0x64, 0xAD);
and
__asm mov al, 0xAD __asm out 0x64, al
do the same... but what do they do??
(doesn't work on NT)
|
|
|
|
|
Neville Franks wrote:
From memory WinExec() is a wrapper around CreateProcess().
I read this same thing, too.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
Because, when you pass the command line, you usually have to include the full file path to the EXE as the first argument on the command line. Traditionally, argv[0] is the path to the program and ANY arguments after that are of interest, so, try this instead...
STARTUPINFO sui;PROCESS_INFORMATION pi;ZeroMemory(&sui, sizeof(STARTUPINFO); sui.cb = sizeof(STARTUPINFO);ZeroMemory(&pi, sizeof(PROCESS_INFORMATION);CreateProcess("hh.exe", "hh.exe MyHelpFile.chm::features.html", NULL, NULL, FALSE, 0, NULL, NULL, &sui, &pi);
Note that I ONLY typed in hh.exe at beginning of command line, you might actually need the FULL file path..
STARTUPINFO sui;
PROCESS_INFORMATION pi;
ZeroMemory(&sui, sizeof(STARTUPINFO);
sui.cb = sizeof(STARTUPINFO);
ZeroMemory(&pi, sizeof(PROCESS_INFORMATION);
CreateProcess("hh.exe", "<full path="" to="" hh.exe="" here=""> <full path="" to="" help="" file="" here="">::features.html", NULL, NULL, FALSE, 0, NULL, NULL, &sui, &pi);
See if that works...
|
|
|
|
|
It works perfectly when I prepend the command-line a "hh.exe " and pass the full path to the executable as first parameter for CreateProcess.
Many thanks!!
Best regards,
Dominik
_outp(0x64, 0xAD);
and
__asm mov al, 0xAD __asm out 0x64, al
do the same... but what do they do??
(doesn't work on NT)
|
|
|
|
|
Hello,
how do I get notified if the user is pressing the minimize button in dialog based app, so I can perform certain operation?
Thanks in advance,
D.
|
|
|
|
|
Implement your own OnSysCommand handler:
void CMyDlg::OnSysCommand(UINT nID, LPARAM lParam)
{
if(nID == SC_MINIMIZE)
{
}
CDialog::OnSysCommand(nID, lParam);
}
Hope that helps, best regards
Dominik
_outp(0x64, 0xAD);
and
__asm mov al, 0xAD __asm out 0x64, al
do the same... but what do they do??
(doesn't work on NT)
|
|
|
|
|
Thanks
|
|
|
|
|
I am working on a graphics application where I draw an ellipse and I need to incorporate a little delay, then erase this ellipse and redraw it elsewhere. I was able to do it very easily in Turbo C using the delay() function. How do I implement this in VC++ 6.0?
log live the dEvIL
|
|
|
|
|
you shuold use the Sleep() function.
it takes 1 parameter(DWORD) which is the time to sleep,in miliseconds.
Regards,
Eli
|
|
|
|
|
I have set a dialog box on the toolbar. There is a Editbox with a Button on the dialog box. The Editbox supposed to get a value from the user and once the Button is pressed, the value will be transfered into a variable in CView. I added a CDialogBar variable m_pointDistro but since there is no class for the dialogbox, I dont know how to add this variable.
Editbox ID is IDC_NPOINTS. I selected new class of the Dialogbox as CView but I was forbided to do that. So the Dialogbox ended up as no class. I chose the Button and added a function called OnDistro().
void CProgramView::Distro() {
CMainFrame* pMainFrame = (CMainFrame*)GetParentFrame();
CEdit* pArray = (CEdit*)(pMainFrame->m_pointDistro.GetDlgItem(IDC_NPOINTS));
.
.
}
1) If I accidentally made the dialogbar has no class, how can i revert back?
2) The coding I used to get value from the dialogbox couldnt work. How can I fix it?
Thanks,
|
|
|
|
|
i want to generate some random numbers,
but with in a limit ( i.e i want to generate the random numbers with in 50) how can i do it by using the rand() ?
Thanks in advance
Ninety-eight percent of the thrill comes from knowing that the thing you designed works, and works almost the way you expected it would. If that happens, part of you is in that machine.
|
|
|
|
|
Try
srand( (unsigned)time( NULL ) );
for( int i = 0; i < 20; i++ )
{
int n = int (50 * ( (double) rand() / RAND_MAX ));
cout << n << "\n";
}
Typical output:
4
48
10
16
27
12
10
27
45
39
24
15
7
3
12
22
24
25
19
28
Kevin
|
|
|
|
|
Kevin McFarlane wrote:
int n = int (50 * ( (double) rand() / RAND_MAX ));
Aaaah, finally someone else who knows the best way to use rand() . Most people just use the % operator, but statistically, using your approach leads to more randomness, as the rand() algorithm has the property that the higher-order bits are more random than the lower order bits.
Or did you just guess?
Either way, well done
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
I just guessed. In fact I'd thought that eli15021979's % method was slicker! But you learn something new every day.
Kevin
|
|
|
|
|
Kevin McFarlane wrote:
In fact I'd thought that eli15021979's % method was slicker!
It is And it will be good enough most of the time, but technically you can do better without having to change an awful lot . In fact, if you use the method you originally posted, modifying it to work with floating-point numbers is relatively trivial - a lot easier than converting one using the modulo operator, since the modulo operator doesn't work for floating-point numbers, well not in C++ at least...
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
Hi,
try this:
srand( (unsigned)time( NULL ));
int num = rand()%50;
Regards,
Eli
|
|
|
|
|
yeah great...thankyou
Ninety-eight percent of the thrill comes from knowing that the thing you designed works, and works almost the way you expected it would. If that happens, part of you is in that machine.
|
|
|
|
|
Of course! Much simpler than mine!
Kevin
|
|
|
|
|
use the modulo (%)
//0 to 49
int nNumber = (rand() % 50);
//1 to 50
int nNumber between1and50 = 1 + (rand() % 50);
|
|
|
|
|
renjith_sree wrote:
i want to generate some random numbers,
Unfortunately this is impossible using a computer algorithm. The best you can hope for is a pseudo-random number.
renjith_sree wrote:
but with in a limit ( i.e i want to generate the random numbers with in 50)...
Is 50 the upper limit or the lower limit?
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
Another issue of mine, I have X devices connected to the computer when my application starts..
I call a function which retrieves a string that represents an identifier for all devices connected. The string is then parsed and I populate a list box with the results. USB-0, USB-1, etc.
I would like to be able to create a dynamic array for each device that is connected.
Any ideas how to do this? Samples?
Thanks again
|
|
|
|