For the most part if you are writing Windows programs I'd use CreateFile,
ReadFile, and WriteFile (or the Ex versions). I just wrote this routine
yesterday (uses MFC sorry) to create a temp file name:
CString GetTempFilePath(LPCTSTR strPattern)
{
CString csPath;
if(GetTempPath(_MAX_PATH,csPath.GetBuffer(_MAX_PAT H+1)) != 0) {
csPath.ReleaseBuffer();
CString csTempFile;
if(GetTempFileName(csPath,strPattern,0,csTempFile. GetBuffer(_MAX_PATH+1))
!= 0) {
csTempFile.ReleaseBuffer();
return csTempFile;
}
}
return CString();
}
Using the functions that Will is referring to. It works pretty well
actually.
Tom
"jigi via DotNetMonster.com" <u14926@uwe> wrote in message
news:561663594f13c@uwe...
i keep getting error when using vc++.net with fopen
William DePalo [MVP VC++] wrote:i have a compiled dll, and i want to see what values ar in certain
methods
during run time. i have built the release build . is there a way to
write
to
a text file on my desktop or qa desktop?
Check the docs for SHGetFolderPath() with CSIDL_DESKTOPDIRECTORY. That
will
get you the fully qualified path to the desktop folder. Use that to create
a
file name.
You have a number of options to create a file name. For example, can use
SetCurrentDirectory() and then GetTempFileName() or _splitpath() and
_makepath().
Once you have a file name, you can create it however you like -
CreateFile(), fopen(), CFile class etc.
Regards.
Will
--
Message posted via DotNetMonster.com
http://www.dotnetmonster.com/Uwe/For...et-vc/200510/1