Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Oct 29th, 2005, 10:45 AM   #11
lectricpharaoh
SEXY SHOELESS GOD OF WAR!
 
lectricpharaoh's Avatar
 
Join Date: Jun 2005
Location: Wet west coast of Canada
Posts: 1,188
Rep Power: 5 lectricpharaoh will become famous soon enough
Look up 'serialization' in your online help (or MSDN). That should get you started. Also, if you mean actual variable/value pairs from an initialization file, rather than just writing to/reading from a config file of your own design, there are API functions for that, too. Be aware, however, that sometimes they will operate on system registry values rather than values in an .INI file; it depends on several factors.
__________________
And once again, Probability proves itself willing to sneak into a back alley and service Drama as would a copper-piece harlot.
- Vaarsuvius, Order of the Stick
lectricpharaoh is offline   Reply With Quote
Old Oct 29th, 2005, 11:52 AM   #12
tempest
Programming Guru
 
tempest's Avatar
 
Join Date: Oct 2004
Posts: 1,041
Rep Power: 6 tempest is on a distinguished road
Send a message via ICQ to tempest Send a message via AIM to tempest Send a message via Yahoo to tempest
It doesn't seem like English is your native language, and i would help you but i don't understand what you are saying.
__________________

tempest is offline   Reply With Quote
Old Oct 30th, 2005, 2:47 PM   #13
BlueNight
Newbie
 
Join Date: Oct 2005
Posts: 14
Rep Power: 0 BlueNight is on a distinguished road
Unhappy Sorry

Hi All Friends Verry Sorry I am not good Speaking english. Because I am verry good spwaking Turkish


I am How write/read in ini files value for TreeView and ListView Component.
BlueNight is offline   Reply With Quote
Old Oct 30th, 2005, 2:51 PM   #14
DaWei
Resident Grouch
 
DaWei's Avatar
 
Join Date: Jun 2005
Posts: 6,453
Rep Power: 10 DaWei is on a distinguished road
Beware, Thanksgiving approaches .
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code.
Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers
DaWei is offline   Reply With Quote
Old Oct 30th, 2005, 4:38 PM   #15
Infinite Recursion
Programming Guru
 
Infinite Recursion's Avatar
 
Join Date: Jul 2004
Location: United States
Posts: 3,473
Rep Power: 8 Infinite Recursion is on a distinguished road
Send a message via MSN to Infinite Recursion Send a message via Yahoo to Infinite Recursion
welcome
__________________
http://jasonpowers.net

"There are a thousand hacking at the branches of evil to one who is striking at the root."
Infinite Recursion is offline   Reply With Quote
Old Oct 30th, 2005, 6:24 PM   #16
The Dark
Expert Programmer
 
Join Date: Jun 2005
Posts: 885
Rep Power: 4 The Dark is on a distinguished road
Quote:
Originally Posted by BlueNight
Hi All Friends Verry Sorry I am not good Speaking english. Because I am verry good spwaking Turkish


I am How write/read in ini files value for TreeView and ListView Component.
You would need to work out how you want the values to appear in the ini file. For a ListView, you could append a number to the end of the key name for each line, so you would end up with:
ListVal1=a
ListVal2=b
ListVal3=c
in your ini file.
Something like this code would do it (treat it as pseudo-code as I don't know all the Borland calls)
TIniFile *StartUp = new TIniFile("c:\\test.ini" );

for (i = 0 ; i < myListView.Items.size(); i++)
{
  char keyName[20];
  sprintf(keyname, "ListVal%d", i);

  StartUp->WriteInteger("Ornek", keyName, myListView.Items[i].ToString);
}
delete StartUp;
If you have more than one column in the listview that you need to save, you could add suffixes for all the columns. e.g.
ListVal1Name=a
ListVal1Address=address a
ListVal2Name=b
ListVal2Address=address b

TreeView components are a bit trickier. One way you could do it is to save the value of each node as in the listview, but also save the depth of each node as well. When you then read the ini file back in, use the depth to determine whether the new node needs to be inserted as a child of the current node, as a sibling of the current node, or as a child of a previous node - probably a recursive reader would be best for this.
The Dark is online now   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 6:49 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC