|
See Here[^]
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
Thank you for the help _AnShUmAn_
Regards,
The only programmers that are better than C programmers are those who code in 1's and 0's.....
Programm3r
My Blog: ^_^
|
|
|
|
|
HI
I want to get two keys from the keyboard simultaneously , I mean when you press and hold two keys the kbhit() and getch() functions return only the first pressed key .
thanks
|
|
|
|
|
V_shr wrote: I want to get two keys from the keyboard simultaneously
This is impossible since the link from the keyboard is serial.
The only way to detect if two keys are pressed simultaniously is if one of them is a shift-key or similar since that would have an impact on the scan code.
"It's supposed to be hard, otherwise anybody could do it!" - selfquote "High speed never compensates for wrong direction!" - unknown
|
|
|
|
|
That is incorrect. The GetAsyncKeyState() function will return the status of any key on the keyboard, up or down.
You can use this macro:
#define KEYDOWN(vk_code) ((GetAsyncKeyState(vk_code) & 0x8000) ? 1 : 0)
to determine if a key is currently being pressed. This will check key state even if your application does not have focus. If you are actually wanting to capture the key presses, you would actually have loop through all of the key codes and check individual status with this method.
Dustin
|
|
|
|
|
Dustin Henry wrote: That is incorrect.
What is incorrect?
Whether the link to the keyboard is serial or not isn't a matter of opinion.
I guess I misinterpreted the OP's problem and what he meant with "simultaneously".
If the question is "how can I determine what keys are being held down", then the answer is "poll the keys with ::GetAsyncKeyState() ", like you suggested.
"It's supposed to be hard, otherwise anybody could do it!" - selfquote "High speed never compensates for wrong direction!" - unknown
|
|
|
|
|
Hello,
I use a template class where I would like to overload the operator [ ].
My intention is that not only the instances of the class will call the operator but also the types of the instances.
I have tried the following code. It works but never the operator [] is called.
Please could tell me if is there a solution to use my own overloaded operator with any type like int, float, long etc..
Thanks for your kind answers.
//ClassTest.h
template <class type>
class ClassTest
{
public:
ClassTest(){};
virtual ~ClassTest(){};
type* Date;
inline type& operator[](UINT i_index){return (at(i_index));};
};
main()
{
// test 1
ClassTest <int> theInt;
theInt.Date = new int[10];
theInt.Date[0] =5; //Does not call type& operator[]
//test2
int array[] = {1996,1997,1998}
ClassTest <int> figure;
figure.Date = array;
int xx = figure.Date[1]; //Does not call type& operator[]
}
|
|
|
|
|
You haven't called the [] operator for the template class in either of your examples.
Instead of
theInt.Date[0] =5; // This is using default [] operator to index into the "Date" member.
it should be
theInt[0] = 5;
This will call your operator but it won't compile since you have no "at()" method defined.
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
Hi
I am making an application using VC++ now i want to run a bunner
i use the dialog based application .
Can any one tell me how we can do this
mailing me
Yogi
|
|
|
|
|
banner ? what is a banner for you ?
|
|
|
|
|
Banner like
" you are most welcome in to ......................"
mailing me
Yogi
|
|
|
|
|
WTF are you talking about ?
can't you explain clearly you need and what you have ?
|
|
|
|
|
I guess he wants to print a banner from a dialog based application
|
|
|
|
|
|
something like this ?
http://www.codeproject.com/staticctrl/bannerstatic2.asp
or like this ?
http://www.codeproject.com/miscctrl/kcsidebannerwnd.asp
|
|
|
|
|
i don't know if it's what the OP was asking for, but CKCSideBannerWnd rocks
|
|
|
|
|
|
if ( youdontspam )
{
youarewelcomehere
}
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.
|
|
|
|
|
if ( youdontspam )
{
breakpoint-->*youarewelcomehere //Yeah it reaches here!
}
Press: 1500 to 2,200 messages in just 6 days? How's that possible sir?
Dr.Brad :Well,I just replied to everything Graus did and then argued with Negus for a bit.
|
|
|
|
|
Is this some kind of sophisticated cross-posting?
"It's supposed to be hard, otherwise anybody could do it!" - selfquote "High speed never compensates for wrong direction!" - unknown
|
|
|
|
|
Just tried *routing* people to the destination
Press: 1500 to 2,200 messages in just 6 days? How's that possible sir?
Dr.Brad :Well,I just replied to everything Graus did and then argued with Negus for a bit.
|
|
|
|
|
Hi
How do I open a new form from a running form ?
regards
|
|
|
|
|
|
Hi
I want to modify nonclient area of windows application,i.e. to modify font in caption, menu and so any body have some hint about this then please send me.
Thanks and Regards
Atul Mahajan
Atul
|
|
|
|
|
Look here [^].
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.
|
|
|
|