Click here to Skip to main content
16,008,010 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralDirectX and MFC Pin
Matt Newman17-Dec-01 10:34
Matt Newman17-Dec-01 10:34 
Questionvisual C++.Net == Visual C++ 7.0 ? Pin
17-Dec-01 10:31
suss17-Dec-01 10:31 
AnswerRe: visual C++.Net == Visual C++ 7.0 ? Pin
Matt Newman17-Dec-01 10:35
Matt Newman17-Dec-01 10:35 
GeneralRe: visual C++.Net == Visual C++ 7.0 ? Pin
Kuniva17-Dec-01 10:53
Kuniva17-Dec-01 10:53 
AnswerRe: visual C++.Net == Visual C++ 7.0 ? Pin
Nemanja Trifunovic17-Dec-01 10:52
Nemanja Trifunovic17-Dec-01 10:52 
QuestionCan I play MPEG in Video for Windows? Pin
JerzyPeter17-Dec-01 10:22
JerzyPeter17-Dec-01 10:22 
Generaltypecasting CString to LPSTR Pin
Dave K Dosanjh17-Dec-01 10:02
Dave K Dosanjh17-Dec-01 10:02 
GeneralRe: typecasting CString to LPSTR Pin
Dave Goodman17-Dec-01 10:20
Dave Goodman17-Dec-01 10:20 
The typical way to convert a CString to a LPSTR is to use CString::GetBuffer(...) and CString::ReleaseBuffer(...) which protect the CString from being mangled by the code playing with the LPSTR. Be sure to read the help for the CString overview and the functions just mentioned to see why. If your code doesn't modify the text, then it's often better to assign the CString to a LPCSTR variable, and then the compiler doesn't complain.

Another thing to keep in mind is that CString will try to keep just one copy of a piece of text when multiple CString's hold the same text. Using GetBuffer and ReleaseBuffer allow the CString to make a local copy of the text so that changing it via an LPSTR won't change the text of all the other CString's. (Which could be a bad thing.)


Dave Goodman
dgoodman@infoway.com
www.dkgoodman.com

GeneralRe: typecasting CString to LPSTR Pin
Michael Dunn17-Dec-01 11:01
sitebuilderMichael Dunn17-Dec-01 11:01 
GeneralRe: typecasting CString to LPSTR Pin
Navin17-Dec-01 14:08
Navin17-Dec-01 14:08 
GeneralAdd User Dialog Pin
Ed K17-Dec-01 9:49
Ed K17-Dec-01 9:49 
GeneralCurious Pin
17-Dec-01 9:07
suss17-Dec-01 9:07 
GeneralRe: Curious Pin
Joaquín M López Muñoz17-Dec-01 9:19
Joaquín M López Muñoz17-Dec-01 9:19 
GeneralRe: Curious Pin
17-Dec-01 9:22
suss17-Dec-01 9:22 
GeneralRe: Curious WHOOPS Pin
17-Dec-01 9:30
suss17-Dec-01 9:30 
GeneralRe: Curious WHOOPS Pin
Joaquín M López Muñoz17-Dec-01 9:45
Joaquín M López Muñoz17-Dec-01 9:45 
GeneralRe: Curious WHOOPS Pin
17-Dec-01 10:50
suss17-Dec-01 10:50 
GeneralRe: Curious WHOOPS Pin
Joaquín M López Muñoz17-Dec-01 11:04
Joaquín M López Muñoz17-Dec-01 11:04 
GeneralRe: Curious Thanks Pin
17-Dec-01 14:20
suss17-Dec-01 14:20 
GeneralSupport to Graph Pin
Tony Li17-Dec-01 8:30
Tony Li17-Dec-01 8:30 
GeneralRe: Support to Graph Pin
Joaquín M López Muñoz17-Dec-01 8:41
Joaquín M López Muñoz17-Dec-01 8:41 
GeneralSocket Communications - buffering problems Pin
Ted Christiansen17-Dec-01 7:58
Ted Christiansen17-Dec-01 7:58 
GeneralRe: Socket Communications - buffering problems Pin
Joaquín M López Muñoz17-Dec-01 9:05
Joaquín M López Muñoz17-Dec-01 9:05 
GeneralHatched Brushes + a Scrolling View = Wacky Lines Pin
D.D. de Kerf17-Dec-01 5:15
D.D. de Kerf17-Dec-01 5:15 
GeneralRe: Hatched Brushes + a Scrolling View = Wacky Lines Pin
Joaquín M López Muñoz17-Dec-01 5:29
Joaquín M López Muñoz17-Dec-01 5:29 

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.