473,385 Members | 1,930 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

writing to text file

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?
--
Message posted via DotNetMonster.com
http://www.dotnetmonster.com/Uwe/For...et-vc/200510/1
Nov 17 '05 #1
4 1386
"jigi via DotNetMonster.com" <u14926@uwe> wrote in message
news:5615c78ca0316@uwe...
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
Nov 17 '05 #2
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
Nov 17 '05 #3
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

Nov 17 '05 #4
"jigi via DotNetMonster.com" <u14926@uwe> wrote in message
news:561663594f13c@uwe...
i keep getting error when using vc++.net with fopen


Which one?

Did you try to diagnose the problem looking at errno or strerror()?

Regards,
Will
Nov 17 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: Neil Trigger | last post by:
Is there a way of creating a seperate text file on a server every time a form is sent? -- ¿ Trigger ? http://www.magic2k.com/ http://www.oddmap.co.uk
2
by: sp | last post by:
Hello everybody, I have an xml doc and I am trying to write the values from xml file to a tab delimited text file. Currently, what I am doing is I am reading xml file through XpathNavigaotr and...
2
by: melanieab | last post by:
Hi, I'm trying to store all of my data into one file (there're about 140 things to keep track of). I have no problem reading a specific string from the array file, but I wasn't sure how to...
3
by: CsharpNewcommer | last post by:
Hi Can someone tell me how to write the data from a TextBox (txt) or Label (lbl) to a text file to be printed. I have read the info from msdn.microsoft.com/library on "Writing Text to a File",...
2
by: Tony | last post by:
Yes, I need to specify a font type so that the characters will be evenly spaced when I write to a tab delimited text file. So how does one specify a font type to write/print and which font is...
0
by: Yunus's Group | last post by:
Yunus's Group May 23, 3:36 pm show options Newsgroups: microsoft.public.dotnet.languages.vb From: "Yunus's Group" <yunusasm...@gmail.com> - Find messages by this author Date: 23 May 2005...
3
by: nicolasg | last post by:
Hi, I'm trying to open a file (any file) in binary mode and save it inside a new text file. After that I want to read the source from the text file and save it back to the disk with its...
3
by: sethuganesh | last post by:
hi, i am not able to write a text properly in a text file in vb.net.below is the code that i have written. Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As...
5
by: grinder | last post by:
first off, i am an extreme newbie to C. i am an undergrad research assistant and i have been shifted to a project that involves building a fairly involved c program. The part that i am stuck on now...
6
by: arne.muller | last post by:
Hello, I've come across some problems reading strucutres from binary files. Basically I've some strutures typedef struct { int i; double x; int n; double *mz;
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.