|
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
ப்ரம்மா
|
|
|
|
|
Hi all,
I would like to disable the 'Pause/Break' key in a console
application. Normally, pressing the 'Pause' key halts the
application's execution. However, this may lead to undesirable
processing gaps in my system. Hence, I would like to disable/ break
key in my console application.
How can I do so?
I tried SetConsoleCtrlHandler. It only able to capture the following events, not "pause" event. Do I need to do it in OS level?
CTRL_C_EVENT
CTRL_BREAK_EVENT
CTRL_CLOSE_EVENT
CTRL_LOGOFF_EVENT
CTRL_SHUTDOWN_EVENT
Thank you.
cheok
|
|
|
|
|
I have to implement 5 strings in a function,so I need to know how to implement array of strings
S.Yamini
|
|
|
|
|
Whith MFC, you can use
CString sMyStrings[5];
(or use a CArray to dynamically handle the strings).
Using STL, you can declare
std::string sMyStrings[5];
(or use a std::vector< std::string > to dynamically...)
Using plain C++, a string is nothing more than a (zero terminated) chunk of chars, hence
char * sMyStrings[5];
sMyString[0]="foo";
...
may fit your needs.
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.
|
|
|
|
|
Thanks.It works great. I want to learn automation in VC++. Can u suggest any links or books for me.
S.Yamini
|
|
|
|
|
Hi All,
when i rational purify it is showing a memory leak in ADO CreateParameter method.
is there really any memory leak?
please do the needful help.
|
|
|
|
|
|
Ok, so thanks to the help I have the program working somewhat correctly, I think. It has 2 loops, a for and while.. one allows the user to keep inputting data into an array that will be defined by the user in size but is no more than 50 values. I have a while loop in this that will ask user to input 1 to continue, 0 to stop entering temperatures. My problem is, I think the values are being stored correctly cause when i choose to output say myarray[0] the correct value I input comes up, but I want to be able to print out how many actual arrays there are in a statement like "Number of readings entered is 12," not the values in them (although I hope i stored each one properly).
This is where I am stuck. From here I have to take the data and make sure its all in centigrade. Im pretty sure I can write a basic function to do this part, but how do I make a statement to call this in my loop as the user inputs functions, and then prints out how many there are? Any help much appreciated thanks.
// Computer Lab test.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <iostream>
using namespace std;
int _tmain(int argc, _TCHAR* argv[])
{
double myarray[51];
int i;
int flag;
flag=1;
for(i= 0; i < 50; i++)
while (flag==1)
{
// loop to enter temperatures - pressing 1 continues, pressing 0 stops //
cout << "Enter Temperature Reading:";
cin >>myarray[i];
cout << "Enter 1 to input more values, 0 to stop";
cin >>flag;
}
std::cout << myarray[i] << std::endl;
return 0;
}
|
|
|
|
|
planetx22 wrote: for(i= 0; i < 50; i++)
while (flag==1)
{
// loop to enter temperatures - pressing 1 continues, pressing 0 stops //
cout << "Enter Temperature Reading:";
cin >>myarray[i];
cout << "Enter 1 to input more values, 0 to stop";
cin >>flag;
}
Modify the above code to the following...
for(i = 0; i < 51 && flag == 1; i++)
{
cout << "Enter Temperature Reading:";
cin >>myarray[i];
cout << "Enter 1 to input more values, 0 to stop";
cin >>flag;
}
cout << "Number of elements in the array is: " << i;
|
|
|
|
|
Ahh.. of course I don't know why I didnt see that before thank you very much. The next thing I need to do is use a function i previously made to convert the values entered in array from fahrenheit (if they are) to celsius. Im just not sure how to make the computer know if the values entered are fahrenheit or not (i know the math formula, just not how to use it). Any help much appreciated thanks.
|
|
|
|
|
planetx22 wrote: The next thing I need to do is use a function i previously made to convert the values entered in array from fahrenheit (if they are) to celsius.
See here[^]
|
|
|
|
|
thanks alot.. got me on the right track i think.
My function goes like -
double my func(double fahrenheit)
{
if (fahrenheit>100) fahrenheit = 1.8 * celsius + 32;
return fahrenheit;
};
Im just not sure how to make the value the user enters into myarray[0-50] go into fahrenheit and then do the check, then return the value to the array either fixed with the formula or not because it was not greater than 100.
Can I do something like in my for loop before the user chooses to continue or stop, or is that the wrong spot? And would it be something like -
myarray[i]=my func(myarray[i]; ?
Thanks alot for the help.
|
|
|
|