|
'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.
|
|
|
|
|
Glad i could help no not my wife
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
Gregor S. wrote:
char *a="a sentence\0";
You don't need the extra \0
Gregor S. wrote:
char *b = new char[strlen(a)];
This is the wrong way. Allways alloc +1 byte for the \0
char *b = new char[strlen(a)+1];
"In an organization, each person rises to the level of his own incompetence." Peter's Principle
|
|
|
|
|
I need to convert a CString into a char*. If the CString is called fldName , then is the following allowed?
char* fldName0 = new char [fldName.GetLength()+1];
strcpy(fldName0, fldName);
The definition of strcpy has two char* as arguments, so I am wondering....
Appreciate your help,
ns
|
|
|
|
|
|
Thank you.
Appreciate your help,
ns
|
|
|
|
|
Nishant S wrote:
(LPTSTR)s
NO NO NO. Sorry, I get upset when I see people do that. That is totally wrong and a bad habit to get newbie programmers into.
First off, the second strcpy() argument is a const char* (I'm avoiding the TCHAR typenames because ns obviously doesn't know them). There is no cast needed because CString has a const char* conversion operator that is called implicitly.
Second, casting a CString to a char* breaks the CString interface -- you are using your knowledge of how a CString works internally, which you must not do to maintain OO encapsulation. The correct way to get a non-const pointer is GetBuffer().
--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
|
|
|
|
|
Michael Dunn wrote:
The correct way to get a non-const pointer is GetBuffer().
Yeah, but ns only wanted a const char *.
To fiddle around with GetBuffer() is unnecessary here, why force CString to allocate new memory when he's only reading it?
But, more to the point, the whole idea of "converting" the CString to char * is a bit fruitless. You can interchange CString operator char * and CString::GetBuffer entirely for read and write operations that need char *, and this will be quicker than what amounts to doing everything twice, not to mention obfuscates the code.
Jon
Signature space for rent. Apply by email to....
|
|
|
|