|
-
May 10th, 1999, 08:53 PM
#1
Converting strings
i have a program whereby i create a dialog box of CFileDialog type.
i get the file name (with path) by the CFileDialog:GetPathName funtion.
i want to send the result to a function having char* as arguement.
but CFileDialog:GetPathName returns is of type 'class CString (void) const',
how do i convert?
fast help appreciated
Tapan
-
May 10th, 1999, 11:13 PM
#2
Re: Converting strings
CString cPath = dlg.GetPathName();
LPTSTR pString = cPath.GetBuffer(1);
someOtherFunc( pString );
If you modify the string pointed to by pString, you must call ReleaseBuffer() before using other CString member functions on the string (see the CString docs).
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|