|
sorry for my persitence...but I am disperate...
|
|
|
|
|
...do you know how can I use fopen_s(); for my problem....please?
void printitems(allinfo *a){
item *i;
itype x1, y1, z1;
FILE *trace;
stype vol;
char s[20];
vol = 0;
trace = fopen_s("NULL","trace.cont","w");...}
|
|
|
|
|
sorry...for this problem...:
void printitems(allinfo *a)//printitem
{
item *i;
itype x1, y1, z1;
FILE *trace;
stype vol;
char s[20];
vol = 0;
trace = fopen("trace.cont","w");....}
|
|
|
|
|
lavy2883 wrote: ...do you know how can I use fopen_s(); for my problem....please?
trace = fopen_s("NULL","trace.cont","w");...}
have you ever tried that code...?
YES, like that !
|
|
|
|
|
Yes y tried...
|
|
|
|
|
lavy2883 wrote: Yes y tried...
...and ???
dude, if you dont want to explain, nobody will help you.
|
|
|
|
|
sorry for misunderstanding....I wanted to ask you how can I use the function fopen_s() which have 3 arguments..instead of fopen() in my problem which have 2 arguments....this is a part of my function...
void printitems(allinfo *a)
{
item *i;
itype x1, y1, z1;
FILE *trace;
stype vol;
char s[20];
vol = 0;
trace = fopen("trace.cont","w");...}
|
|
|
|
|
1. Have you looked up the syntax for fopen_s() on MSDN? (HINT - this is always a good idea for functions you use for the first time.)
2. When you have done (1), carefully check the parameters you are passing.
Does everything look OK?
Peter
"Until the invention of the computer, the machine gun was the device that enabled humans to make the most mistakes in the smallest amount of time."
|
|
|
|
|
adapt your code[^]
if you code is supposed to compile on several compilers, keep fopen()...
otherwise, if you don't mind using only MSVC compiler, then do he following.
instead of this :
FILE* trace;
trace = fopen("trace.cont", "w");
do this :
FILE* trace = NULL;
fopen_s(&trace, "trace.cont", "w");
and next time, read the docs and search more by yourself instead of asking dunb questions
|
|
|
|
|
toxcct wrote: can't you navigate backward and get your answers ?
But then he would not get to experience your ire!
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
just shoot me in the head man. I know where it's going right from the first post, yet I still
keep reading... AHHHHHHHHHHH
"If you can dodge a wrench, you can dodge a ball."
|
|
|
|
|
toxcct wrote: SPAM
ohh.. now spam on forum too .. ooohs!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and you
|
|
|
|
|
How to delete the entry done with the CWinApp::WriteProfileString().
not programatically. how to do it directly?
thank you.
KIRAN PINJARLA
|
|
|
|
|
kiran.pinjarla wrote: How to delete the entry done with the CWinApp::WriteProfileString().
not programatically. how to do it directly?
I think the api writes entries into win.ini file. Open the file, and remove your entry.
Nobody can give you wiser advice than yourself. - Cicero
ப்ரம்மா
|
|
|
|
|
brahmma wrote: the api writes entries into win.ini file.
I found no entries of my application in the win.ini file.
Is the any other file that i should search?
KIRAN PINJARLA
|
|
|
|
|
The documentation says it is written in to the win.ini file. It also says that the system maps most .ini file references to the registry. Please read the documentation. http://msdn2.microsoft.com/en-us/library/ms725504.aspx[^]
Nobody can give you wiser advice than yourself. - Cicero
ப்ரம்மா
|
|
|
|
|
brahmma wrote: Please read the documentation. http://msdn2.microsoft.com/en-us/library/ms725504.aspx[^]
Thank you brahmma.
It helped me.
KIRAN PINJARLA
|
|
|
|
|
"WriteProfileString" API writes the entries into an .ini file in the system folder(Ex: C:\\WINDOWS\{application name}.ini).
Open the file, and delete the entry you want.
Thanks & Rgds,
Sri..
|
|
|
|
|
Thank you.
PSrividya wrote: Ex: C:\\WINDOWS\{application name}.ini).
I could not find the ini file with my application name. Should i search for it any where else?
KIRAN PINJARLA
|
|
|
|
|
PSrividya wrote: in the system folder(Ex: C:\\WINDOWS\{application name}.ini).
What exactly? Can you give a link where this stuff is said?
PSrividya wrote: Rgds,
Saving the key strokes?
Nobody can give you wiser advice than yourself. - Cicero
ப்ரம்மா
|
|
|
|
|
Sorry. The file name doesnt need to be the application name.
Syntax: WriteProfileString ("file name", "section", "key", "string") where the first parameter is the file name in which the key entry has to be made.
Thanks & Rgds,
Sri..
|
|
|
|
|
PSrividya wrote: Syntax: WriteProfileString ("file name", "section", "key", "string") where the first parameter is the file name in which the key entry has to be made.
Huh? If you want to specify the file name by yourself, you need to use WritePrivateProfileString . WriteProfileString takes just 3 arguments.
Nobody can give you wiser advice than yourself. - Cicero
ப்ரம்மா
|
|
|
|
|
WriteProfileString writes to the registry, not just an ini.
To remove a profile string from the registry you need to get the key such as theApp.GetAppRegistryKey, tunnel to the key you want deleted and then use RegDeleteKeyEx.
|
|
|
|
|
i am using win2000professional does it differ in this behaviour?
KIRAN PINJARLA
|
|
|
|
|
No
Nobody can give you wiser advice than yourself. - Cicero
ப்ரம்மா
|
|
|
|