writing to text file
Collapse
This topic is closed.
X
X
-
jigi via DotNetMonster.comTags: None -
William DePalo [MVP VC++]
Re: writing to text file
"jigi via DotNetMonster.c om" <u14926@uwe> wrote in message
news:5615c78ca0 316@uwe...[color=blue]
>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?[/color]
Check the docs for SHGetFolderPath () with CSIDL_DESKTOPDI RECTORY. 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
SetCurrentDirec tory() 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
-
jigi via DotNetMonster.com
Re: writing to text file
i keep getting error when using vc++.net with fopen
William DePalo [MVP VC++] wrote:[color=blue][color=green]
>>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?[/color]
>
>Check the docs for SHGetFolderPath () with CSIDL_DESKTOPDI RECTORY. 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
>SetCurrentDire ctory() 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[/color]
--
Message posted via DotNetMonster.c om
Best online pokies for real money in Australia and learn about safety and game mechanics in this comprehensive guide.
Comment
-
Tom Serface
Re: writing to text file
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,csPat h.GetBuffer(_MA X_PATH+1)) != 0) {
csPath.ReleaseB uffer();
CString csTempFile;
if(GetTempFileN ame(csPath,strP attern,0,csTemp File.GetBuffer( _MAX_PATH+1))
!= 0) {
csTempFile.Rele aseBuffer();
return csTempFile;
}
}
return CString();
}
Using the functions that Will is referring to. It works pretty well
actually.
Tom
"jigi via DotNetMonster.c om" <u14926@uwe> wrote in message
news:561663594f 13c@uwe...[color=blue]
>i keep getting error when using vc++.net with fopen
>
> William DePalo [MVP VC++] wrote:[color=green][color=darkred]
>>>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?[/color]
>>
>>Check the docs for SHGetFolderPath () with CSIDL_DESKTOPDI RECTORY. 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
>>SetCurrentDir ectory() 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[/color]
>
>
> --
> Message posted via DotNetMonster.c om
> http://www.dotnetmonster.com/Uwe/For...et-vc/200510/1[/color]
Comment
-
William DePalo [MVP VC++]
Re: writing to text file
"jigi via DotNetMonster.c om" <u14926@uwe> wrote in message
news:561663594f 13c@uwe...[color=blue]
>i keep getting error when using vc++.net with fopen[/color]
Which one?
Did you try to diagnose the problem looking at errno or strerror()?
Regards,
Will
Comment
Comment