|
I had grabbed the first likely CButton function I saw (my first time using the checkbox - I actually hunted for CCheckBox and finally figured out from class wizard its a CButton!). GetCheck works fine.
Thanks a bunch.
Appreciate your help,
ns
|
|
|
|
|
I put a checkbox on my form and ran it. It wont check if I click in it! I want to do stuff if its checked so I use GetState() to get that info, but I cant even get it checked at runtime! What do I need to set? I didnt set its initial state as checked or anything so its blank when it starts...
Appreciate your help,
ns
|
|
|
|
|
are u looping somewhere???
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
Do you do an UpdateData(FALSE) BEFORE checking the state of the button in your callback?
Michel
It is a lovely language, but it takes a very long time to say anything in it, because we do not say anything in it, unless it is worth taking a very long time to say, and to listen to.
- TreeBeard
|
|
|
|
|
No. Does it matter that I have a CBUtton variable called m_check whose state I want to check? I'll try the updatedata(false) idea right now...
Appreciate your help,
ns
|
|
|
|
|
Do you have 'Auto' style set for this particular checkbox in resource editor?
Tomasz Sowinski -- http://www.shooltz.com
*** Vodka. Connecting people. ***
|
|
|
|
|
No> I set it to lefttext....is that okay?
Appreciate your help,
ns
|
|
|
|
|
'Left text' and 'Auto' flags are not mutually exclusive (because they have totally different meaning). Without 'Auto' your code is responsible for switching the state of checkbox when user clicks. Turn 'auto' on and you'll be OK.
Tomasz Sowinski -- http://www.shooltz.com
*** Vodka. Connecting people. ***
|
|
|
|
|
Right you are! I didnt know what auto meant....
Appreciate your help,
ns
|
|
|
|
|
I didn't know that either. Cool info, tx
Michel
It is a lovely language, but it takes a very long time to say anything in it, because we do not say anything in it, unless it is worth taking a very long time to say, and to listen to.
- TreeBeard
|
|
|
|
|
|
attach a int to this radio button using classWizard member variable, then set this to the number of the radio button in the group:
Lets say group is like follows:
o Red (Group checked in the ressource editor)
o Green
o White
and u wanna set White so u attach an int let say its named iRadioChoice and u put somewhere:
iRadioChoice = 2; // Bettter to name the values in an enum!
UpdateData ( FALSE ) ;
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
I'm using Win32 not MFC thanks anyway man
|
|
|
|
|
Are you using Win32 API or MFC? One solution is SetCheck().
Kuphryn
|
|
|
|
|
|
Here is one solution.
// Enable a dialog control
EnableWindow(GetDlgItem(hDlg, ID_EDIT), TRUE)
// Disable a dialog control
EnableWindow(GetDlgItem(hDlg, ID_EDIT), FALSE)
Kuphryn
|
|
|
|
|
I have a
char* a ="a sentence" . I need to copy this into another char* b , after allocating enough memory to b.
I am very unsure about how to get the length of a so I can do
char *b = new char[a_length+1];
If I use strlen , how exactly do I code this?
a_length = strlen(*a);
or
a_length = strlen(a);</
Appreciate your help,
ns
|
|
|
|
|
|
char *a="a sentence\0";
char *b = new char[strlen(a)];
make sure your string "a" is null-terminated. I don't know whether this is necessary, though
modified 12-Sep-18 21:01pm.
|
|
|
|
|
That sounds good too. Though I am wondering if the way you have definred the string it now has two NULLS at the end....?
Appreciate your help,
ns
|
|
|
|
|
Gregor's code is wrong, Nish already gave you the correct answer. Use strlen() to count the characters, then add 1 for the terminating 0 character.
--Mike--
Just released - 1ClickPicGrabber - Grab & organize pictures from your favorite web pages, with 1 click!
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|
|
|
But the string needs to be null-terminated, or am I wrong?
He could also write char a[] = "a sentence";
Now you have confused me totally
modified 12-Sep-18 21:01pm.
|
|
|
|
|
just by doing char* pcChar = "";
u have a null terminated string, u usualy dont add \0 to the string but in special cases, like a filter for a CFileDialog for instance
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
Oh my god, it's really awkward I didn't know that
Sorry Michael, thanks Papa
regards
btw. nice signature you have there, is Bebe your wife?
modified 12-Sep-18 21:01pm.
|
|
|
|