write to a text file
-
Hi all , i am trying to write a text file to a given location like c:\abc.txt can anybody help me here.. Thanks in adavnce
vikas
-
Hi all , i am trying to write a text file to a given location like c:\abc.txt can anybody help me here.. Thanks in adavnce
vikas
You can use of CFile class for read and write.
-
i am just trying to write a text file to some specified path... that will contain some string data .... as an example.. if i have a string "hii i am here in code project" so this will be written there in the text file (text file will be created from code) please help out me here Thanks in advance
vikas
-
You can use of CFile class for read and write.
-
Thanks Hamid, i think this is inbuild class but i want to do this by code just like... 1. create a text file 2.Open the file in read/write mode 3.append the text/write the text 4.close the file thanks alot guys for help
vikas
tasumisra wrote:
i think this is inbuild class
:confused: What ? You can perfectly use CFile in your code, what's the problem ? Just look in MSDN how to use the class.
Cédric Moonen Software developer
Charting control [v1.2] -
tasumisra wrote:
i think this is inbuild class
:confused: What ? You can perfectly use CFile in your code, what's the problem ? Just look in MSDN how to use the class.
Cédric Moonen Software developer
Charting control [v1.2] -
i dont want to use class CFile : public CObject BECAUSE i am writing a COM component in that i need to put some log so there i cant use CFILE may be it can be used there but i dont know.. so please help me in this context Thanks...
vikas
Use a std::ofstream instead.
#include using namespace std; ... ... ofstream MyFile("Output.txt"); MyFile << "Hello World" << endl;
Cédric Moonen Software developer
Charting control [v1.2] -
Use a std::ofstream instead.
#include using namespace std; ... ... ofstream MyFile("Output.txt"); MyFile << "Hello World" << endl;
Cédric Moonen Software developer
Charting control [v1.2] -
use these win32 API's CreateFile,WriteFile
dlfkgj lsdfkglfkgjlfgl jldfk fldkk jk
-
Hi all , i am trying to write a text file to a given location like c:\abc.txt can anybody help me here.. Thanks in adavnce
vikas
-
i dont want to use class CFile : public CObject BECAUSE i am writing a COM component in that i need to put some log so there i cant use CFILE may be it can be used there but i dont know.. so please help me in this context Thanks...
vikas
tasumisra wrote:
i am writing a COM component...
Which is an advanced topic. If writing to a text file is troubling you, COM will be next to impossible.
tasumisra wrote:
...may be it can be used there...
Certainly it can, but that's irrelevant at this point.
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
-
tasumisra wrote:
i am writing a COM component...
Which is an advanced topic. If writing to a text file is troubling you, COM will be next to impossible.
tasumisra wrote:
...may be it can be used there...
Certainly it can, but that's irrelevant at this point.
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
-
DavidCrow wrote:
COM will be next to impossible
NO BODY is there who knows COM BY BIRTH .... here only everybody had learnt and me too... will prove it...
vikas
tasumisra wrote:
will prove it...
Good luck.
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne