|
Here is a link to the entire article. However, if you are using Windows 9x or NT, you'll need to employ a system-wide hook. See this article for details.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
GetLastInputInfo not working properly in Windows 2000
Error: Undefined Identifier for GetLastInputInfo
please explain
Jack
|
|
|
|
|
This is what MSDN says:
Requirements
Windows NT/2000: Requires Windows NT 3.1 or later.
Windows 95/98: Requires Windows 95 or later.
Header: Declared in Winuser.h; include Windows.h.
Library: Use user32.lib.
And what do you mean by not working properly?
Can u give details on the improper working?
...Avenger
Remember... testing & debugging are always part of programming ...so exterminate those stinking bugs
|
|
|
|
|
avenger_sb25 wrote:
Windows 95/98: Requires Windows 95 or later.
The function is not available on Windows 9x platforms.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
Please provide a code snippet of how you are using the function.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
I am using Windows 2000 here is the snippet
#include "stdafx.h"
int APIENTRY WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nCmdShow)
{
LASTINPUTINFO plii;
memset(&plii,0,sizeof(plii));
plii.cbSize = size(plii);
if(GetLastInputInfo(&plii ))
{
//code here
}
return 0;
}
Even if I declare the LASTINPUTINFO structure in the header file its not working
Sandy
|
|
|
|
|
Well, since what you have is not a true Windows application (e.g., you need a window and a message pump), I'm not sure how GetLastInputInfo() is supposed to behave. I may be incorrect, but it wouldn't hurt to at least provide the minimum.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
Even if I provide a window and check the messages it gives
a error saying "Undefined Identifier for "GetLastInputInfo()
Jack
|
|
|
|
|
Is this a compiler, linker, or run-time error?
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
|
What other files are being #include d in stdafx.h?
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
Only the windows.h and the winuser.h
Jack
|
|
|
|
|
Have you defined _WIN32_WINNT ? If not, look at line #5040 of winuser.h.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
Hi CPians!
I have a MFC Dlg app, that should be able to fire up an unlimited amount of dialogs when clicking on one button (e.g. one dialog per click). In the OnClickButton handler, if i run my code that way :
CMyDialog mydlg;
mydlg.DoModal();
the main dialog freezes after the first child dialog is started (of course, that's the way modal dialog are meant to work).
If I do it this way :
CMyDialog mydlg;
mydlg.Create(...);
mydlg.Show();
the dialog is closed as soon as I leave the OnClickButton , that is almost instantly, since mydlg is a local variable in that function.
So what I intend to do is launch the dialog modal in a working thread, but this semms to be a bit paradoxical to me. Is it any better solution, or is this the ultimate one ?
Thanks a lot
~RaGE();
|
|
|
|
|
Rage wrote:
CMyDialog mydlg;mydlg.Create(...);mydlg.Show();
the dialog is closed as soon as I leave the onclickButton, that is almost instantly, since mydlg is a local variable in that function.
why don't you declare CMyDialog as member variable or global variable or static variable, that will work exactly as you intend.
C makes it easy to shoot yourself in the foot; C++ makes it harder, but when you do, it blows away your whole leg
|
|
|
|
|
mailMonty wrote:
why don't you declare CMyDialog as member variable or global variable or static variable, that will work exactly as you intend.
Because I do not know how many of them I will need (see in my post, you fire up a dlg every time you click on a button). So declaring them as global would require a dynamical global array of dlgs
~RaGE();
|
|
|
|
|
mailMonty wrote:
C makes it easy to shoot yourself in the foot; C++ makes it harder, but when you do, it blows away your whole leg
very good sig
~RaGE();
|
|
|
|
|
You may use:
CMyDialog *pmydlg=new CMyDialog;
pmydlg->Create(...);
pmydlg->Show();
to create the modeless dialog who's PostNcDestroy should look like this:
void CMyDialog::PostNcDestroy()
{
CDialog::PostNcDestroy();
delete this;
}
rechi
|
|
|
|
|
Thanks rechi, I had already thought about something like this, i missed the existence of PostNcDestroy . Thanks again.
~RaGE();
|
|
|
|
|
Rage wrote:
Thanks
A pleasure
Rage wrote:
i missed the existence of PostNcDestroy
I knew it...
rechi
|
|
|
|
|
in your button event,you should like this:
CMyDialog mydlg=new CMyDialog;
mydlg.Create(...);
mydlg.Show();
in the class of CMyDialog
you should add a function
CMyDialog::PostNCDestroy()
{
delete this;
}
|
|
|
|
|
coolaka wrote:
CMyDialog mydlg=new CMyDialog;
mydlg.Create(...);
mydlg.Show();
Yep, even better with a pointer (see rechi's post) IMO. Thanks a lot for your help.
~RaGE();
|
|
|
|
|
I want to record mp3 file with mciSendString and use this code
<br />
- mciSendString("open new type waveaudio alias capture", 0, 0, 0);<br />
- mciSendString("set capture bitspersample 8", 0, 0, 0);<br />
- mciSendString("set capture samplespersec 11025", 0, 0, 0);<br />
- mciSendString("set capture channels 2", 0, 0, 0);<br />
- mciSendString("record capture",0,0,0);<br />
- mciSendString("save capture c:\\test.mp3",0,0,0);<br />
when test.mp3 file saved, I play it with windowmedia and one error occur "ClassFactory cannot supply requested class (Error=80040111)"
somebody can help me to fix it, thanks
Nho'c Ti`
|
|
|
|
|
HI;
Which headfile is include the GetLastInputInfo function ?
GFL
|
|
|
|
|
How did you find out the function exists ? If from the MSDN, it tells you what header to include.
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|