🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #8585

Drives Problem

#8585
From: Pat
Date: Wed, 06 Oct 2004 22:18
31 lines
1957 bytes
Hello, I am trying to write a small program and am trying to find a solution
to keeping some information the end user would like to keep. I figure the
best way to do this is either through the registry or an INI file.

I can get the drive set once using a drive combo box and the next time I
restart the porgram I get the proper drive but it reverts back to "C:" on
the next restart.

In the "on close" section I want to use

WinIni->WriteString("Drive", "CDROM", DriveComboBox1->Drive);

Then in the on create section I would like to call the last drive used with
something like:
     Edit1->Text = WinIni->ReadString("Drive", "CDROM",
DriveComboBox1->Drive);

This works for the first  time I restart the program but on the next boot
Edit1 returns to "C"

It seems to me the I should be able to read this information from the same
INI file but when I try:
     DriveComboBox1->Drive = WinIni->ReadString("Drive", "CDROM",
DriveComboBox1->Drive);

I get an error ( [C++ Error] Unit1.cpp(52): E2034 Cannot convert
'AnsiString' to 'char')

Can someone point out the error of my ways?

Thjank you for your help
Technical Details
Message-ID: <41646f40@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!news.agarik.com!npeer.de.kpn-eurorings.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,67c77ee0f1e6771c,start
X-Google-Attributes: gid10cc67,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Pat" <pclancy@sasktel.net>
Newsgroups: borland.public.cppbuilder.nativeapi
Subject: Drives Problem
Date: Wed, 6 Oct 2004 16:18:47 -0600
Lines: 33
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2600.0000
X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2600.0000
NNTP-Posting-Host: 142.165.101.187
Message-ID: <41646f40@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1097101120 142.165.101.187 (6 Oct 2004 15:18:40 -0700)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!news.agarik.com!npeer.de.kpn-eurorings.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail