|
when i try to search , my temp directory will fill with many files about 6-7 Mb and i dont want them , How can i avoid them ?
how can i make - do not make files in my temp directory ?
this is my code :
void CName::OnChangeName1()
{
CString sSQLL,sDen;
CDatabase_1BunView1* pBun = new CDatabase_1BunView1();
if (!pBun->Open(CDatabase_Bun::forwardOnly))
return;
if (pBun->IsOpen())
{
m_gestiuneaDb.GetWindowText(sSQLL);
m_dengestiuneDb.GetWindowText(sDen);
pBun->GetRecordCount();
while (!pBun->IsEOF())
{
CString strWord;
strWord = pBun->m_cod;
strWord.TrimLeft(); // Remove leading spaces
strWord.TrimRight(); // Remove trailing spaces
if (sSQLL == pBun->m_cod)
{
m_dengestiuneDb.SetWindowText(pBun->m_den);
}
pBun->MoveNext();
}
}
pBun->Close();
}
Bravoone
|
|
|
|
|
So you create dynamically an instance of CDatabase_1BunView1 each time you press the button ? And you even don't destroy it at the end of the function.
Make it a member variable of your class and initialize it once for all and destroy it in the destructor of your class.
|
|
|
|
|
please can you show me how can i do that ?
Bravoone
|
|
|
|
|
Uuhh
Simply create a member variable of your class instead of recreating each time you press the button. If you don't understand that, then you should first learn the basis of C++. We cannot help if you don't understand what we are telling.
|
|
|
|
|
ok but where i must define the member variabile for my class CRecordset ?
Bravoone
|
|
|
|
|
Bravoone_2006 wrote: where i must define the member variabile for my class CRecordset ?
The same place that all class members are defined. It would really behoove you to learn the basics of C++ (e.g., terminology) before embarking on such an ambitious project.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
In your class you can declare your variables
|
|
|
|
|
and is so hard to explain how ? ...if you really know !
Bravoone
|
|
|
|
|
do you really think you'll get some answers and some respect by attacking people like you do ?
|
|
|
|
|
Bravoone_2006 wrote: and is so hard to explain how ?
It is not that it is really hard, but it is quite long. And I don't think that all the C++ basis will fit in the message.
Or, I could make it short but seing your questions, I don't think that will help. So, to make a variable member of a class, just declare it in the class itself:
class CMyClass
{
private:
int m_MyVariable;
};
But honnestly, if you don't want to learn C++ (like you said in a previous post), don't expect that people will write your program for you. I suggest to that if you don't want to make an effort, then pay somebody to make it for you.
I saw that you are a hardware engineer, so it is a little bit like if I ask you how to build a television but I don't want to learn how electronics work...
|
|
|
|
|
no you dont understand , i like c++ and i want to learn , but is nobody who can explain me things !
this is my hobby and this is what i want to ... i want to make this programm for me to demonstate , i can do this , you now?!!
ok thanks for your help !
...and see you soon !
Bravoone
|
|
|
|
|
Bravoone_2006 wrote: but is nobody who can explain me things !
Honnestly, no. The problem comes from the fact that you seem to lack even the basis of C++ concepts. So, a lot of people tried to help you already but it is impossible to make you understand some simple concepts without going first through the basis. If you REALLY want to learn, you should stop what you are doing now (way to complicated) and search for a book or a tutorial on the web that will start from the begining. You don't even seem to grasp the concept of classes, which is highly needed for the things you are trying to do. You should learn how to walk before trying to run.
|
|
|
|
|
You couldn't have summed it up any better!
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
But he still doesn't seem to understand: [^]
I'm giving up
|
|
|
|
|
Reminds me of my three-year old. While you're giving him the answer, he's asking the question (again).
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
if you are new to c++ i think its hard for you to write a database program
|
|
|
|
|
i have this massage you know what is this ? and what i must do ?
local variable 'm_Bun' used without having been initialized
i have this :
class CMyClass
{
private:
int m_Bun;
}
Bravoone
|
|
|
|
|
It is a warning that says that you use this variable without setting a value to it. You should always initialize your member variables in the constructor of your class.
|
|
|
|
|
if i dont specify that when i write something in CEdit my program is cloasing ! WHY ???????
CDatabase_Bun *m_prs = new CDatabase_Bun;
----->>>>>>>> new <<<<<<<<<<<-------
Bravoone
|
|
|
|
|
Bravoone_2006 wrote: local variable 'm_Bun' used without having been initialized
C4700
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
if you dont need to int m_Bun; you can delete it from your program
|
|
|
|
|
How can i remove spaces in my database ?
my database : visualfoxpro 6.0
CDatabase_Name::CRecordset
(MFC)
col1 = "name"
col2 = "city"
col3 = "country"
tank you in advance !
Bravoone
|
|
|
|
|
It seems this question is for sql forum
|
|
|
|
|
Bravoone_2006 wrote: How can i remove spaces in my database ?
You asked the same question
Here
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
I guess i saw this question previous
|
|
|
|