Click here to Skip to main content
15,913,941 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Convert Time to CString? Pin
Niklas L2-Nov-06 21:42
Niklas L2-Nov-06 21:42 
QuestionDerived classes and over riding Pin
Waldermort2-Nov-06 3:41
Waldermort2-Nov-06 3:41 
AnswerRe: Derived classes and over riding Pin
benjymous2-Nov-06 4:22
benjymous2-Nov-06 4:22 
GeneralRe: Derived classes and over riding Pin
Waldermort2-Nov-06 4:55
Waldermort2-Nov-06 4:55 
AnswerRe: Derived classes and over riding Pin
Mark Salsbery2-Nov-06 8:15
Mark Salsbery2-Nov-06 8:15 
GeneralRe: Derived classes and over riding Pin
Waldermort2-Nov-06 9:43
Waldermort2-Nov-06 9:43 
AnswerRe: Derived classes and over riding Pin
Michael Dunn2-Nov-06 9:12
sitebuilderMichael Dunn2-Nov-06 9:12 
Questionassigning string to char Pin
Tara142-Nov-06 3:23
Tara142-Nov-06 3:23 
Hello,

I want to assign a string stored in a CString to char data type. I am unfamiliyar with char data types. They are, somehow, totally beyond my understanding!

Basically, I am getting the path of a file in strFileName. I want to extract only the file name from it. This is what I am trying to do:

if (dlg.DoModal() == IDOK)
{
	strFileName.Format("%s",dlg.GetPathName());
	// Add to MRU list
	AfxGetApp()->AddToRecentFileList(strFN);

	// extract the file name
	char filePath[_MAX_PATH];
	char drive[_MAX_DRIVE];
	char dir[_MAX_DIR];
	char fname[_MAX_FNAME];
	char ext[_MAX_EXT];
	
	filePath = strFN;  // ---> this is wrong. Plz can you tell me the correct way.

	_splitpath( filePath, drive, dir, fname, ext );
	CString st; st.Format("%s%s",fname,ext);
	SetWindowText(st);
	pDoc->IsNew = FALSE;

} 


Thanks.


Fortitudine Vincimus!

AnswerRe: assigning string to char Pin
David Crow2-Nov-06 3:28
David Crow2-Nov-06 3:28 
GeneralRe: assigning string to char Pin
Tara142-Nov-06 4:38
Tara142-Nov-06 4:38 
AnswerRe: assigning string to char Pin
bosfan2-Nov-06 4:23
bosfan2-Nov-06 4:23 
QuestionAccess PoolNonPagedBytes Pin
suresh_suryavanshi2-Nov-06 3:15
suresh_suryavanshi2-Nov-06 3:15 
AnswerRe: Access PoolNonPagedBytes Pin
Mark Salsbery2-Nov-06 8:21
Mark Salsbery2-Nov-06 8:21 
GeneralRe: Access PoolNonPagedBytes Pin
suresh_suryavanshi5-Nov-06 18:26
suresh_suryavanshi5-Nov-06 18:26 
QuestionNot responding in task bar icon Pin
MikeRT2-Nov-06 2:59
MikeRT2-Nov-06 2:59 
AnswerRe: Not responding in task bar icon Pin
Mark Salsbery2-Nov-06 8:24
Mark Salsbery2-Nov-06 8:24 
GeneralRe: Not responding in task bar icon Pin
MikeRT2-Nov-06 17:22
MikeRT2-Nov-06 17:22 
GeneralRe: Not responding in task bar icon Pin
Mark Salsbery2-Nov-06 20:06
Mark Salsbery2-Nov-06 20:06 
QuestionMulti line support for static control Pin
see me2-Nov-06 2:58
see me2-Nov-06 2:58 
AnswerRe: Multi line support for static control Pin
_AnsHUMAN_ 2-Nov-06 3:06
_AnsHUMAN_ 2-Nov-06 3:06 
GeneralRe: Multi line support for static control Pin
see me2-Nov-06 3:20
see me2-Nov-06 3:20 
GeneralRe: Multi line support for static control Pin
David Crow2-Nov-06 3:32
David Crow2-Nov-06 3:32 
GeneralRe: Multi line support for static control Pin
PJ Arends2-Nov-06 7:37
professionalPJ Arends2-Nov-06 7:37 
QuestionHide program? Pin
Larsson2-Nov-06 1:57
Larsson2-Nov-06 1:57 
AnswerRe: Hide program? Pin
_AnsHUMAN_ 2-Nov-06 2:24
_AnsHUMAN_ 2-Nov-06 2:24 

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.