Click here to Skip to main content
16,007,277 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: passing iwebbrowser2 across threads Pin
geo_m18-Jan-03 23:53
geo_m18-Jan-03 23:53 
GeneralAccessing Controls Within Stacked Dialogs Pin
Aanidaani18-Jan-03 6:45
Aanidaani18-Jan-03 6:45 
GeneralRe: Accessing Controls Within Stacked Dialogs Pin
Gary R. Wheeler18-Jan-03 13:57
Gary R. Wheeler18-Jan-03 13:57 
GeneralRe: Accessing Controls Within Stacked Dialogs Pin
Aanidaani18-Jan-03 23:01
Aanidaani18-Jan-03 23:01 
Generalnonactivated dialog Pin
s98769018-Jan-03 6:30
s98769018-Jan-03 6:30 
GeneralRe: nonactivated dialog Pin
Michael Dunn18-Jan-03 6:46
sitebuilderMichael Dunn18-Jan-03 6:46 
GeneralCString GetBuffer Pin
nss18-Jan-03 6:15
nss18-Jan-03 6:15 
GeneralRe: CString GetBuffer Pin
Michael Dunn18-Jan-03 6:51
sitebuilderMichael Dunn18-Jan-03 6:51 
Check out my C++ string classes[^] article where I cover CString in detail.

But to summarize, dbName.GetBuffer(128) makes sure that the dbName buffer is at least 128 characters long (allocating more space for you, if necessary) and returns a non-const pointer to the buffer. You can then use that pointer as if it were a normal C-style string.

When you call any other CString methods (such as the = operator), that pointer may become invalid because some CString methods delete/reallocate the buffer.

nss wrote:
SO if I just did dbName = "aaaaaaaaaaaaaaaaa" directly who takes care of the fact that dbName was zero bytes long before?

CString manages its own memory (except for when you explicitly take control of the memory with GetBuffer()).

--Mike--
I'm bored... Episode I bored.
1ClickPicGrabber - Grab & organize pictures from your favorite web pages, with 1 click!
My really out-of-date homepage
Sonork-100.19012 Acid_Helm

GeneralRe: CString GetBuffer Pin
nss18-Jan-03 12:37
nss18-Jan-03 12:37 
QuestionHow to put the content of scrollview into one bitmap? Pin
ashxly18-Jan-03 5:32
ashxly18-Jan-03 5:32 
AnswerRe: How to put the content of scrollview into one bitmap? Pin
Mike Nordell18-Jan-03 7:12
Mike Nordell18-Jan-03 7:12 
Generaldeleting a registry key Pin
nss18-Jan-03 5:00
nss18-Jan-03 5:00 
GeneralRe: deleting a registry key Pin
User 665818-Jan-03 5:21
User 665818-Jan-03 5:21 
GeneralRe: deleting a registry key Pin
Stephane Rodriguez.18-Jan-03 5:26
Stephane Rodriguez.18-Jan-03 5:26 
GeneralRe: deleting a registry key Pin
nss18-Jan-03 5:51
nss18-Jan-03 5:51 
GeneralRe: deleting a registry key Pin
Stephane Rodriguez.18-Jan-03 6:12
Stephane Rodriguez.18-Jan-03 6:12 
GeneralRe: deleting a registry key Pin
nss18-Jan-03 6:45
nss18-Jan-03 6:45 
GeneralRetrieving application directory Pin
georgiek5018-Jan-03 3:29
georgiek5018-Jan-03 3:29 
GeneralRe: Retrieving application directory Pin
User 665818-Jan-03 3:46
User 665818-Jan-03 3:46 
GeneralRe: Retrieving application directory Pin
Dominik Reichl18-Jan-03 3:57
Dominik Reichl18-Jan-03 3:57 
GeneralRe: Retrieving application directory Pin
georgiek5018-Jan-03 4:18
georgiek5018-Jan-03 4:18 
GeneralOLE Automation server and NT Services Pin
PaulVdB18-Jan-03 0:17
PaulVdB18-Jan-03 0:17 
GeneralAPI Pin
suresh_sathya17-Jan-03 23:23
suresh_sathya17-Jan-03 23:23 
Questionwhich function counts the number of directories? Pin
Geert Craessaerts17-Jan-03 23:06
Geert Craessaerts17-Jan-03 23:06 
AnswerRe: which function counts the number of directories? Pin
Ted Ferenc17-Jan-03 23:20
Ted Ferenc17-Jan-03 23:20 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.