|
The PBT_APMSUSPEND event (in a WM_POWERBROADCAST message) doesn't indicate
the system is entering hibernate state?
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
It seems Windows does not send PBT_APMSUSPEND nor PBT_APMQUERYSUSPEND (in WM_POWERBROADCAST ) when going to sleep. I've found some other power functions in the meanwhile (CallNtPowerInformation , GetActivePwrScheme , ...), maybe one of these helps...
Thanks anyway for your reply, best regards
Dominik
|
|
|
|
|
Hi all
My computer had installed a video-capture-card at recent(PCI slot).
I use VC8,
What software development kit can do it best?
DirectX show or platform SDK or other?
thanks!
|
|
|
|
|
DirectShow[^], which is now in the platform SDK, can do
it well.
For Vista+ only development, there's the
Microsoft Media Foundation SDK[^].
For legacy stuff, there's still Video For Windows[^]
but it's getting a little dated and doesn't provide much functionality
compared to the other two above.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
|
Hello everyone,
I am learning code from others, but I do not know why the following code section can compile?
Why assignment p = new (void (*[3])()) is ok? Are the left side and right side of assignment having compatible type?
[Code]
void (**p)();
int main()
{
p = new (void (*[3])());
return 0;
}
[/Code]
thanks in advance,
George
|
|
|
|
|
Arrays names are synonim of const pointer (to the same type) hence the magic.
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.
[my articles]
|
|
|
|
|
Thanks CPallini!
Why "Arrays names are synonim of const pointer" could apply to my question? Could you provide more information please?
regards,
George
|
|
|
|
|
George_George wrote: void (**p)();
int main()
{
p = new (void (*[3])());
return 0;
}
void (**p)();
declares a pointer to a pointer to a function accepting no arguments and returning no arguments.
new (void (*[3])());
allocates memory for an array of pointers to functions accepting no argument and returning no value.
p can be initialised with the address of the first element of the array, i.e. with the (implicit) array name.
For instance, try the following:
void fun1() { printf("Hi");}
void fun2() { printf(" George");}
void (**p)();
int main()
{
p = new (void (*[3])());
p[0] = fun1;
p[1] = fun2;
p[2] = fun2;
p[0]();
p[1]();
p[2]();
}
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.
[my articles]
|
|
|
|
|
Thanks CPallini,
Your sample is great! My question is answered.
regards,
George
|
|
|
|
|
Hello everyone,
I am learning structured exception from,
http://msdn2.microsoft.com/en-us/library/ms681409(VS.85).aspx
I read a couple of links from MSDN, but still confused what is structured exception, what is the differences between structure exception and our normal C++ exception, like bad_alloc and various user define exception?
thanks in advance,
George
|
|
|
|
|
|
Thanks Hamid,
Looks comprehensive! I just briefly read through the article and it seems structured exception is totally different from normal C++ exception. Looks like another approach to produce/handle exceptions, but I have never used and met any API in MSDN documented structured exception before.
Do you have any experience where should we use structured exception?
regards,
George
|
|
|
|
|
if i select Cancel button, or select the Close option from the dialog box's other controls of my application are not working there is sum error how can i remove this error.
thanks and regards
|
|
|
|
|
v.j wrote: there is sum error
Maybe posting the error and the affected code will help.
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.
[my articles]
|
|
|
|
|
If you click on cancel, won't the app close? Care to explain your problem?
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
v.j wrote: ...my application are not working there is sum error...
Would that be error A or error B?
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
v.j wrote: my application are not working there is sum error
That is very poor description of your error. Without knowing what it is, no one can really help.
"I guess it's what separates the professionals from the drag and drop, girly wirly, namby pamby, wishy washy, can't code for crap types." - Pete O'Hanlon
|
|
|
|
|
|
dear all
i already added in main function #include <iomanip> and using std::setw. why after i use cout statement setw(3)..no response..what happened?thanks
Li Zhiyuan
5/10/2006
|
|
|
|
|
If cout is used, include iostream.h
Come online at:-
jubinc@skype
|
|
|
|
|
already added it,any other problem? thanks
Li Zhiyuan
5/10/2006
|
|
|
|
|
Please post the code and state what you expect the code should do.
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.
[my articles]
|
|
|
|
|
the code is following:
double a[3][4];
for (int j = 0; j <<10; j++)
{
double a[3][4] = {{(double)rand()/RAND_MAX, (double)rand()/RAND_MAX, (double)rand()/RAND_MAX,( double)rand()/RAND_MAX},{(double)rand()/RAND_MAX,(double)rand()/RAND_MAX,(double)rand()/RAND_MAX,(double)rand()/RAND_MAX},{(double)rand()/RAND_MAX,(double)rand()/RAND_MAX,(double)rand()/RAND_MAX,(double)rand()/RAND_MAX}};
cout<< setw(3)<< "Particle" << setw(3) << j << endl << endl;
for (int i = 0; i<< 3; i++)
{
for (int j = 0; j<< 4; j++)
cout <<setw(3)<< setprecision(6) << fixed << showpoint << a[i][j]<< " ";
cout << endl;
}
cout<< endl;
}
how to save each array a and the setw is not available....
Li Zhiyuan
5/10/2006
|
|
|
|
|
Anybody have an opinion on include guards:
#ifndef _thisheader_h_included
#define _thisheader_h_included
versus using pragma once?
#pragma once
I suppose the pragma directive is less portable across platforms, but is that the only issue?
|
|
|
|