|
is it possible to make a normal button pressed and lock it until its pressed again?
|
|
|
|
|
yes, it is.
set a radio or a checkbox, and change its property "Toogle Button" to True
|
|
|
|
|
thnx for the reply.
but the problem here is i hav more than 1000 buttons in my applicaton, so quit big work to change those buttons to check boxes and set toggle to true. can u provide me way for normal buttons.
Raj Gopal
|
|
|
|
|
Various Ways.-
1. Find out in a 3 button dialog what needs replacement, Load the .RES File in a Wordprocessor, and make relevant changes by Text replacement.
2. I do not believe that you wrote all this code for more than 1000 buttons, without testing for 2 or 3 first. but, maybe that's experience on my part
3. If you have thousands of buttons in your dialog template, you're at the wrong end of the stick. in 'OnInitDialog(), run a for(...)statement to go through each item to first retrieve the style, and then add the relevant style bit.
There's an Old Irish saying though,
"If I wanted to go where you tell me you want to go, If I where you, I would not have started where you are now". Think about it!!!
LateNightsInNewry
|
|
|
|
|
radio button and check boxes ARE normal buttons... only the style changes...
|
|
|
|
|
create a checkbox/button and set the BS_PUSHLIKE style ( either by code or in the resource editor )
|
|
|
|
|
Can someone direct me to information on how to 'activate' a button (that is either ON or OFF) without clicking on it ---- using only code to manipulate the action that would normally occur if the user clicked on it.
Thanks very much.
John P.
|
|
|
|
|
CButton m_button;
m_button.EnableWindow(TRUE);
|
|
|
|
|
Do you mean:
(1) making the button to have the Focus ?
SetFocus();
(2) making the button Enabled?
EnableWindow(TRUE);
(3) making the button (previously hidden) to appear?
ShowWindow(SW_SHOW);
(4) ...
hope that helps...
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.
|
|
|
|
|
What Language are U Using?? What Compiler, etc.!
LateNightsInNewry
|
|
|
|
|
1) Use SendInput
2) Use two SendMessage calls, one with WM_LBUTTONDOWN and one with WM_LBUTTONUP with the appropriate coordinates.
3) Use mouse_event (I think it still exists).
- S
50 cups of coffee and you know it's on!
|
|
|
|
|
Actually I have 2 bytes hexavalue and I want to convert into decimal value in C language could some one tell me how can i do that.
ikram
|
|
|
|
|
if you have two bytes worth of data that you want to interpret as an integer: __int16 i = *(__int16 *)pYour2Bytes;
if you have two strings:
char *p;
int i1 = strtol(pStr1, &p, 16);
int i2 = strtol(pStr2, &p, 16);
int i = (i1 << 8) + i2;
if you have one string:
char *p;
int i = strtol(pStr1, &p, 16);
|
|
|
|
|
thx..
I have some thing like that.
unsigned char DATA[25]; // DATA array consist of hex values.
I want to convert DATA[1] and DATA[2] contain hexadecimal values that is (0x00 0x02) into the decimal value.plz let me knw accordindly..thanks in advance.
|
|
|
|
|
__int16 i = *(__int16 *)pYour2Bytes;
FYI: unsigned chars do not contain "hexadecimal values" . a uchar contains 8 bits which can be combined to represent numeric values from 0 to 255 in decimal, or 0 to 0xff hex, or 0377 in octal, or 00000000 to 11111111 in binary, or any other base you prefer to use.
|
|
|
|
|
Please explain what you want to achieve. It appears you want to read two Text Strings, base 16, and combine them into one int.Why only shift 8 bits,etc. A lot depends on your End Pointer &p, which appears to be not modified between calls. How are you sure that p points to a valid end value in BOTH Strings. Me thinks that your code cannot make sense!
See your Standard header File for
'long strtol( const char *nptr, char **endptr, int base );'
LateNightsInNewry
|
|
|
|
|
(methinks your reply was misplaced)
|
|
|
|
|
sorry i was away-
unsigned char DATA[25];
Array contain different hexavalues(One function fills the values in DATA array). Now I want to read DATA[1] and DATA[2] values combinely.
let suppose,
DATA[1]=0x0b
DATA[2]=0x0b
The Decimal values for 16 bit(2 bytes DATA[1]& DATA[2]) is 187..
plz explain me how can i do that.thx
|
|
|
|
|
sorry..
DATA[1]=0x0b
DATA[2]=0xb0
The decimal value is 187.
|
|
|
|
|
__int16 i = *(__int16 *)&DATA(1);
|
|
|
|
|
thx for the help done.
|
|
|
|
|
if you have the string-representation of the hex number, such as "F5", the you may use strtol function, e.g.
char *pEnd;
long nVal = strtol("F5", &pEnd, 16);
hope that helps.
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.
|
|
|
|
|
I have following situation:
class A {...}
class B : public A {...}
can i do this:
A *a = new B;
delete a;
Thank you for reading and even more for answering
|
|
|
|
|
I cannot see any question marks, but since the written code isn't obviously wrong or bad the conclusion is this:
The written code is maybe ok.
Problems might occur if the base class destructor isn't declared virtual ; if so, the derived class destructor will never be called and memory might leak.
|
|
|
|
|
Yes of course. Why not ?
If you want the destructor of B to be called, you need to make the destructor of A virtual (take this habbit: whenever you have a class that can be inherited, declare its destructor virtual)
|
|
|
|