🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: List Files

#3215
From: Renan
Date: Mon, 31 Jul 2006 13:51
35 lines
1952 bytes

>  if(OpenDialog1->Execute())
>  {
>    StringGrid1->RowCount = OpenDialog1->Files->Count;
>    StringGrid1->Cols[0] = OpenDialog1->Files;
>  }
>
>Then let the user rename the files. (Or do you want to rename 
>them by an algorithm? Then you wouldn't even need the grid).
>
>If you want to display filenames without paths in the grid, look
>for ExtractFileName().

        if(OpenDialog1->Execute())
        {
        Edit1->Text = ExtractFileName(OpenDialog1->FileName);
        Edit2->Text = ExtractFileName(OpenDialog1->FileName);
        }

With this code, even if I select 2 diferent files, Edit1 and Edit2 
gets the same filename. What can I do to select 2 files?

        if(OpenDialog1->Execute())
        {
        Edit1->Text = ExtractFileName(OpenDialog1->Files);
        Edit2->Text = ExtractFileName(OpenDialog1->Files);
        }

With this code, I get an error msg:

[C++ Error] Unit1.cpp(32): E2034 Cannot convert 'TStrings * const' to 'AnsiString'
[C++ Error] Unit1.cpp(32): E2342 Type mismatch in parameter 'FileName' (wanted 'const AnsiString', got 'TStrings *')

What's wrong?
Technical Details
Message-ID: <44ce0ad7$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news2.google.com!news4.google.com!news.glorb.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail
References: <44c97103$1@newsgroups.borland.com> <44c9b8d0$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,fe8a549e850bf32c
X-Google-Attributes: gid10cc67,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Renan" <gulbrrs@gmail.com>
Sender: "Renan" <gulbrrs@gmail.com>
Reply-To: "Renan" <gulbrrs@gmail.com>
Subject: Re: List Files
Newsgroups: borland.public.cppbuilder.nativeapi
X-User-Info: 200.182.147.10     
X-Forwarded-For: 192.168.0.138
References:  <44c97103$1@newsgroups.borland.com> <44c9b8d0$1@newsgroups.borland.com>
NNTP-Posting-Host: 207.105.83.66
Message-ID: <44ce0ad7$1@newsgroups.borland.com>
Date: 31 Jul 2006 06:51:19 -0700
X-Trace: newsgroups.borland.com 1154353879 207.105.83.66 (31 Jul 2006 06:51:19 -0700)
Lines: 35
Path: arc1-ca.pugleaf.net!g2news2.google.com!news2.google.com!news4.google.com!news.glorb.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail