|
<br />
COLORREF colorref;<br />
BYTE r,g,b;<br />
for(int i=0;i<20;i++)<br />
for(int j=0;j<20;j++)<br />
{<br />
colorref=GetPixel(hdc,i,j);<br />
<br />
r=GetRValue(colorref);<br />
g=GetGValue(colorref);<br />
b=GetBValue(colorref);<br />
CString str;<br />
str.Format("r=%d,g=%d,b=%d",r,g,b);<br />
m_Edit.SetWindowText(str);<br />
}<br />
<br />
|
|
|
|
|
Hi there,I have an VC++ application that is using a CListControl and the problem is that when i press ESC, it executes the function for adding text in the list that i am using.How to check why is this happening and how pressing ESC and the function i wrote are connected?
I tried with WM_KEY but it didn't work.
Thanx in advance
|
|
|
|
|
What code do you have in place for monitoring the Esc key?
"The largest fire starts with but the smallest spark." - David Crow
|
|
|
|
|
Message Closed
modified 28-Sep-16 7:19am.
|
|
|
|
|
oliver_mak wrote: case VK_ESCAPE :OnEscape();
But what does OnEscape() do?
"The largest fire starts with but the smallest spark." - David Crow
|
|
|
|
|
Message Removed
modified 28-Sep-16 7:29am.
|
|
|
|
|
Well, normally in a dialog, pressing <ESC> triggers IDCANCEL (simulates pressing [Cancel] ). If you have something mapped to the same identifier value as IDCANCEL, or something in a OnCancel(...) handler, it may get triggered by pressing <ESC> .
I had a similar problem one when my resources got messed up oen time and one of my buttons took on the same ID value as IDCANCEL - since there was no real [Cancel] button on the dialog, the RC allowed me to do so.
Peace!
-=- James If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! DeleteFXPFiles & CheckFavorites (Please rate this post!)
|
|
|
|
|
Everything I've been able to read about cppunit shows how to build the TestRunner code in either the InitInstance() or the Main function of an executable. I have 20+ dlls that I want to be able to test individually, and I was hoping there is an easier way to test them besides writing a test App that I would have to create to run tests on the dlls. Thanks for your time and help!
|
|
|
|
|
Hi,
Can I implement the property grid with VC++ 8 (VisualStudio 2005)? where can I find an example?
I'm new to program with .NET, and I'd like to know where it's possible to me to have an example project
Thanks
|
|
|
|
|
|
is there any thing like static class in c++
thank u
kk.
|
|
|
|
|
static class, no.
static instance of a class yes.
please explain where you heard this, and what you want to be detailed...
TOXCCT >>> GEII power
[VisualCalc 3.0 updated ][Flags Beginner's Guide new! ]
|
|
|
|
|
hello toxcct,
it was asked to me in an interview,
u r saying we have a static class , like
static class A{ ----- };
and if i create an object for it what happens???
kk
|
|
|
|
|
dude !!!
didn't you read what i said, or didn't you understand ?
when i say you cannot define a class as static, it means that you CANNOT define a class like you do :
<font color=red>static</font> class CFoo {
};
what i said however is that you are allowed to declare an instance of a class as static, that means a variable which type is a user-defined type :
#include "Foo.h"
static CFoo foo;
now, what don't you understand ?
you'd certainly google the internet or even better, search a good C++ book for static concept...
TOXCCT >>> GEII power
[VisualCalc 3.0 updated ][Flags Beginner's Guide new! ]
|
|
|
|
|
kumar_windows wrote: u r saying we have a static class , likestatic class A{ ----- };and if i create an object for it what happens???
Dude There is nothing like Static class, as class doesnot have any address till is object is created, so how can you make anything static which doesn't exist till it object is created
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
kumar_windows wrote: is there any thing like static class in c++
What do you mean exactly ? Can you be more explicit and explain what you want to do exactly ?
Yes, you can declare a class static like any other variable but I don't know if this is what you are looking for.
Cédric Moonen
Software developper
Charting control
-- modified at 9:43 Friday 12th May, 2006
Sorry, not very clear . As toxxct said (and what I meant by saying that) is declaring an instance of a class static, not the class itself
|
|
|
|
|
Cedric Moonen wrote: Yes, you can declare a class static like any other variable
actually, you're not declaring the class static but the instance of the class...
TOXCCT >>> GEII power
[VisualCalc 3.0 updated ][Flags Beginner's Guide new! ]
|
|
|
|
|
Yes, my post has already been modified . It's friday afternoon so my english skills tend to decrease
Cédric Moonen
Software developper
Charting control
|
|
|
|
|
Cedric Moonen wrote: Sorry, not very clear . As toxxct said
damn, toxcct, not toxxct think to "toxicity" if that can help... anyway, ok, friday afternoon... hehehe
TOXCCT >>> GEII power
[VisualCalc 3.0 updated ][Flags Beginner's Guide new! ]
|
|
|
|
|
Do you think it's easy not to make mistakes while typing with your nose ?
Cédric Moonen
Software developper
Charting control
|
|
|
|
|
|
Cedric Moonen wrote: while typing with your nose ?
Again Nose
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
hello cedric,
it was an interview question,
u mean to say i can declare a class as static like
static class A{----};
what is its purpose, please elaborate on single instance of a class, u mean when i create an object for this class
thanks kk
|
|
|
|
|
kumar_windows wrote: is there any thing like static class in c++
Are you looking something like SingleTon Classes[^]?
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
hi alok,
no not a singleton class, it was an interview question abt the static class, do we have it just like a static member variable and static function,
wat is its significance/purpose?? can i create an object for this static class?? wat happens?
thank u, kk
|
|
|
|