Click here to Skip to main content
15,887,294 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Finding/Loading resources Pin
David Crow6-May-03 6:02
David Crow6-May-03 6:02 
GeneralRe: Finding/Loading resources Pin
will13836-May-03 6:47
will13836-May-03 6:47 
GeneralRe: Finding/Loading resources Pin
will13836-May-03 7:21
will13836-May-03 7:21 
GeneralProblem regerding LineTo(..) Pin
summo6-May-03 3:21
summo6-May-03 3:21 
GeneralRe: Problem regerding LineTo(..) Pin
JensB6-May-03 4:42
JensB6-May-03 4:42 
GeneralRe: Problem regerding LineTo(..) Pin
John R. Shaw6-May-03 7:07
John R. Shaw6-May-03 7:07 
GeneralCFile %&% Pin
macmac386-May-03 2:50
macmac386-May-03 2:50 
GeneralRe: CFile %&% Pin
Mike Zinni6-May-03 3:15
Mike Zinni6-May-03 3:15 
You might want to try:

CFileDialog dlg(FALSE);
CString fname = dlg.GetPathName(); 
const char* szBuffer = fname.GetBuffer(0);
int i = fname.GetLength();

CFile f;
// CFile::modeWrite is OK if you want to append
// data to the end of the file. If you're looking
// to create a new file and have it contain JUST this
// filename, you need to open the CFile with the 
// CFile::modeCreate flag.
if( f.Open ("F:\\test\\id.txt", CFile::modeWrite ) )
{
  try{
    f.Write(szBuffer, i);
    f.Close();
  } catch (CFileException *e)
  {
    AfxMessageBox ("Error!");
    e->Delete();
  }
}
// And remember to release your string pointer.
fname.ReleaseBuffer();


-Mike Zinni

"No sh*t it's tough. If it wasn't, everybody and their sister would be an engineer and then you wouldn't have a job."
GeneralRe: CFile %&% Pin
macmac386-May-03 3:24
macmac386-May-03 3:24 
GeneralRe: CFile %&% Pin
macmac386-May-03 3:54
macmac386-May-03 3:54 
GeneralRe: CFile %&% Pin
Mike Zinni6-May-03 4:10
Mike Zinni6-May-03 4:10 
GeneralRe: CFile %&% Pin
macmac386-May-03 4:45
macmac386-May-03 4:45 
GeneralRe: CFile %&% Pin
David Crow6-May-03 4:49
David Crow6-May-03 4:49 
GeneralRe: CFile %&% Pin
macmac387-May-03 3:56
macmac387-May-03 3:56 
GeneralRe: CFile %&% Pin
David Crow6-May-03 4:20
David Crow6-May-03 4:20 
GeneralRe: CFile %&% Pin
Hans Ruck6-May-03 3:18
Hans Ruck6-May-03 3:18 
Generalstring substitution Pin
JensB6-May-03 2:49
JensB6-May-03 2:49 
GeneralRe: string substitution Pin
G. Steudtel6-May-03 4:02
G. Steudtel6-May-03 4:02 
QuestionHow to create a Virtual Serial Port with C++? Pin
d.schaeflein6-May-03 2:47
d.schaeflein6-May-03 2:47 
GeneralConvert "unsigned char[8]" to long Pin
Abebe6-May-03 2:42
Abebe6-May-03 2:42 
GeneralRe: Convert "unsigned char[8]" to long Pin
Xander806-May-03 2:52
Xander806-May-03 2:52 
GeneralRe: Convert "unsigned char[8]" to long Pin
Abebe8-May-03 4:55
Abebe8-May-03 4:55 
Generalshow web Page in a dialog box.. Pin
xxhimanshu6-May-03 2:39
xxhimanshu6-May-03 2:39 
GeneralRe: show web Page in a dialog box.. Pin
Joan M6-May-03 3:30
professionalJoan M6-May-03 3:30 
GeneralRe: show web Page in a dialog box.. Pin
Majid Shahabfar6-May-03 4:29
Majid Shahabfar6-May-03 4: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.