|
I would say: "my application isn't able to take advantage of fopen ", because I'm pretty sure fopen works fine on your system.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
kapardhi wrote: ...fopen doesn't work in my system!!
Actually it does if used correctly. Care to show us a code snippet?
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
TRY.log file is what i want to create
pchFilePath = ""c:\\Documents and Settings\\Kapardhi\\Desktop\\Oct22\\\\TRY.log";
CFile *fp;
fp = fopen(pchFilePath, "a+");
it gives unhandled exception error after execution of fopen ();
|
|
|
|
|
kapardhi wrote: pchFilePath = ""c:\\Documents and Settings\\Kapardhi\\Desktop\\Oct22\\\\TRY.log";
Why are you doing this?
kapardhi wrote: it gives unhandled exception error after execution of fopen ();
So why do you not show what is happening after execution of fopen() ?
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
that is the path where i want to create the file
At the end there are \\\\ i.e computer takes as
"c:\Documents and Settings\Kapardhi\Desktop\Oct22\\MyTry.log"
this"\\" implies any string before "\\" is path, and string after "\\" is the name of the file to be created
|
|
|
|
|
You totally missed the question. Why are you using the 2 extra backslashes?
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
that is the path where i want to create the file
At the end there are \\\\ i.e computer takes as
"c:\Documents and Settings\Kapardhi\Desktop\Oct22\\MyTry.log"
this"\\" implies any string before "\\" is path, and string after "\\" is the name of the file to be created
|
|
|
|
|
kapardhi wrote: this"\\" implies any string before "\\" is path, and string after "\\" is the name of the file to be created
While the compiler may excuse the "error" and the file is indeed getting opened, I would consider changing it to a single backslash to avoid any future problems.
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
kapardhi wrote: this"\\" implies any string before "\\" is path, and string after "\\" is the name of the file to be created
You should create your own OS in order to fullfill such a requirement.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Believe me, It was working previously !
|
|
|
|
|
Until what?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Actually i made some changes in other part of my code after making those changes this fopen() started to fail !!
|
|
|
|
|
Actually there are rules on building paths. Your path is invalid. Stop.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
If you think i am wrong you may try it !!
Actually i wasted my time, expecting that you may give a good suggestion !!
|
|
|
|
|
kapardhi wrote: If you think i am wrong you may try it !!
Yes, I think you are wrong. Stop.
kapardhi wrote: Actually i wasted my time, expecting that you may give a good suggestion !!
Definitely, yes.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
kapardhi wrote: Actually i wasted my time...
No, it appears that you are wasting ours. How can you expect to get help when you do not answer our questions, and withold important information? We're not mind readers. Several here will bend over backwards to help those in need, but it all starts with you providing all relavent information.
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
i am sorry to say that " i wasted my time"
yesterday i was in some tension as my code was not working, so i replied in that dirty manner!
i am really sorry!
thanks for testing my code snippet!
there might be some problem in my code, i shall check it!!
bye..
|
|
|
|
|
CPallini wrote: Your path is invalid.
Actually it's not. I would never do that, but the compiler is a little more forgiving.
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
It's invalid for Mr. Operative System, not for Mr.Compiler.
Am I wrong?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
CPallini wrote: Am I wrong?
It works. Give it a go.
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
Have you made a test of his snippet, with the double 'double quotes'?
Have you really assigned a FILE pointer to a CFile * variable?
Does it work?
I'll try.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
CPallini wrote: Have you made a test of his snippet, with the double 'double quotes'?
Yes, sort of.
CPallini wrote: Have you really assigned a FILE pointer to a CFile * variable?
No, I totally overlooked that part. I just assumed it was being assigned to a FILE* . Mark that as another thing I would not do.
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
DavidCrow wrote: CPallini wrote:
Have you made a test of his snippet, with the double 'double quotes'?
Yes.
Well, hence you know it doesn't compile (with the duplcate startin double quotes), at least on VC6.
DavidCrow wrote: CPallini wrote:
Have you really assigned a FILE pointer to a CFile * variable?
No.
I had no doubt about. It obviously doesn't even compile.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Prior to using CFile , this worked fine:
FILE *pFile = fopen("C:\\Documents and Settings\\davidc\\My Documents\\\\LotusInstall.log", "a+");
fprintf(pFile, ...);
fclose(pFile); Trying to assign fopen() 's return value to a CFile object, rather than a CStdioFile object, is what the compiler is complaining about.
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
Yeah, I made a test, following your advice. It seems you can put the double slash almosta anywhere...
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|