Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CString to char*

Status
Not open for further replies.

Jaredino

Technical User
Jan 31, 2006
17
GB
Hi,
I have read lots of posts on this but still can't come up with any answers. I have a CString named 'm_sResults1' that needs to be passed to a function named 'openWavFile()' that expects a char*. How do I convert a CString to a char*??
 
Use GetBuffer() and then call ReleaseBuffer after openWavFile(). If that function takes a const char* (which it probably should if it simply opens a file) then you can pass the CString directly because it will be automatically converted.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top