|
read this[^]... it might be a good starting point to solve your problem !
|
|
|
|
|
sam1173 wrote: ...it has problems.
Such as?
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
Use the force David, use the force!
|
|
|
|
|
Please post more details. It is very difficult to answer this question if you don't give us more information.
Project4Hire.com - Find Freelance Progammers and Graphic Designers for all your project needs
|
|
|
|
|
Hi ,
My Problem goes like this -:
1. I want to store similar set of data together .
2. so that wen i ask for a certain type i get the whole set.
3. Wen we are storing the data we dont know how many such set will come.
Basically i want to group devices of same type(same name) together, and i get them in random order.
How should i approach this so that i wont have any performance hit , while retreiving
Regards,
FarPointer
-- modified at 13:42 Thursday 20th April, 2006
|
|
|
|
|
|
Any Links to know more
Regards,
FarPointer
|
|
|
|
|
Yup i got your idea i will let you know .
Regards,
FarPointer
|
|
|
|
|
FarPointer wrote: 1. I want to store similar set of data together .
Are you talking about a struct , or an array?
FarPointer wrote: 3. Wen we are storing the data we dont know how many such set will come.
Ok, so just allocate memory dynamicaly. Some classes handle this automatically.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
Thanx for the reply .
it was basically an implementaion of map of vector as told by kuphyer.
It was storing an object of type
CMyDevice{ CString szName ; CString szDevice;....};
on the basis of same name in CMyDevice.
Regards,
FarPointer
|
|
|
|
|
I have 2 apps: A and B.
A is a java application - similar to DOS - so let's say A is a Console.
A can work independently.
now B uses CreateProcess() and CreatePipe() to establish communications between B and A.
when B exits, A must work itself as running independently.
problem is that I have to recover A's in, out and error handles to independent states - as A is running itself.
do you know how to recover these stream handles?
A special image tool for C++ programmers, don't miss it!
The world unique Software Label Maker is here for you and me ...
A nice hyper tool for optimizing your MS html-help contents.
|
|
|
|
|
includeh10 wrote:
do you know how to recover these stream handles?
Use CloseHandle() on the handles returned by CreatePipe() .
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
|
im using VC++6 MFC, i want to create and save some data out to a file such as a csv file or even better a excel file.
I know of CFileDialog to bring up a save dialog but how do i pump out data in a csv or excel format
thanks
|
|
|
|
|
have your data as comma seperated values each row seperated by newline adn then jsut give the file .csv extension. That's how I used to do it.
|
|
|
|
|
how did you write the data out thou, i see there is CArchive but doesnt appear to do much!!
|
|
|
|
|
|
viperlogic wrote: im using VC++6 MFC, i want to create and save some data out to a file such as a csv file or even better a excel file.
To communicate with Excel, you can use its ODBC driver, or Excel automation.
viperlogic wrote: I know of CFileDialog to bring up a save dialog...
CFileDialog has nothing to do with how the data is saved. It is for filename selection only.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
|
im wanna go down the csv route.
i am using the CArchive as follows
CFile f;
char strFilter[] = { "csv Files (*.csv)|*.csv|All Files (*.*)|*.*||" };
CFileDialog FileDlg(FALSE, ".csv", NULL, 0, strFilter);
if( FileDlg.DoModal() == IDOK )
{
f.Open(FileDlg.GetFileName(), CFile::modeCreate | CFile::modeWrite);
CArchive ar(&f, CArchive::store);
ar<< m_Make << m_Model << m_Year << m_Mileage << m_Owner;
ar.Close();
}
else
return;
f.Close();
the above is coming out in one cell with a rectangular box after each string
how do i get ride of those retangular boxes and have a string in a seperate cell
thanks
|
|
|
|
|
viperlogic wrote: the above is coming out in one cell
But what does it look like when viewed with Notepad?
Try:
CStdioFile f;
...
ar << m_Make << ',' << m_Model << ',' << m_Year << ',' << m_Mileage << ',' << m_Owner << endl;
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
still get the boxes as seen below
a,b,c,d,e
|
|
|
|
|
Which implies that m_Make , m_Model , m_Year , m_Mileage , and m_Owner have an odd character in them. Yes?
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
CString m_Make="a";
CString m_Model ="b";
CString m_Year ="c";
CString m_Mileage ="d";
CString m_Owner="e";
for testing purposes i have them as above, so where is this box coming from!!!
|
|
|
|
|
viperlogic wrote: so where is this box coming from!!!
Unicodedness of your program without writing the unicode-header?
A decent file editor (as opposed to a CEdit-gone-application like notepad) like Ultraedit would show it.
"We trained hard, but it seemed that every time we were beginning to form up into teams we would be reorganised. I was to learn later in life that we tend to meet any new situation by reorganising: and a wonderful method it can be for creating the illusion of progress, while producing confusion, inefficiency and demoralisation."
-- Caius Petronius, Roman Consul, 66 A.D.
|
|
|
|