473,326 Members | 2,110 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

Problem with TStringList and GetFileNames function

This is what I need to do, Pass the path, type in and a TStringList
pointer into the function. The caller must create and delete the
TString list, this function simply fills it with filenames and their
directory. If the Boolean is true, the TStringList of filenames will
return in random order otherwise they will return in the order they
are stored in the directory.

Problem with both lines:
TStringList* LIST = new TStringList();
Test.GetFileNames("*.jpg","c:\\pics",LIST, true);

Code
---

MAIN
==================
C_Random Test;

void __fastcall TForm1::Open1Click(TObject *Sender)
{
if (!OpenPictureDialog1->Execute()) return;
AnsiString FileExt = ExtractFileExt(OpenPictureDialog1->FileName);
//PROBLEM HERE!!!
TStringList* LIST = new TStringList(); // IS THIS RIGHT?
Test.GetFileNames("*.jpg","c:\\pics",LIST, true);
}

=================

Class File
==-=======

class C_Random
{
public:
//int GetFileNames(AnsiString Type, // e.g.
"*.jpg"
//AnsiString Dir, // e.g. "c:\\photos"
//TStringList* FileNamesList, // Return the list of
filenames
//bool Random = true); // Randomise the list
if true

int GetFileNames(AnsiString Type, AnsiString Dir, TStringList*
FileNamesList, bool Random = true);

private:
};

int C_Random::GetFileNames(AnsiString Type, AnsiString Dir,
TStringList* FileNamesList, bool Random)
{
//
}

Mar 25 '07 #1
1 2106
On 25 Mar 2007 13:23:28 -0700, "Xoomer" <sh*****@gmail.comwrote in
comp.lang.c++:
This is what I need to do, Pass the path, type in and a TStringList
pointer into the function. The caller must create and delete the
TString list, this function simply fills it with filenames and their
directory. If the Boolean is true, the TStringList of filenames will
return in random order otherwise they will return in the order they
are stored in the directory.
[snip]

What you need to do is ask this question in Windows programming group,
like news:comp.os.ms-windows.programmer.win32, because the things you
are asking about are Microsoft specific and not defined by the C++
language.

--
Jack Klein
Home: http://JK-Technology.Com
FAQs for
comp.lang.c http://c-faq.com/
comp.lang.c++ http://www.parashift.com/c++-faq-lite/
alt.comp.lang.learn.c-c++
http://www.club.cc.cmu.edu/~ajo/docs/FAQ-acllc.html
Mar 25 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Lentdave67t | last post by:
Thank you in advance for any help you can provide. I am writing a C# program that checks to see if the URLs of favorites/bookmarks are still good. The problem I am having is that while the...
2
by: Lentdave67t | last post by:
Thank you in advance for any help you can provide. I am writing a C# program that checks to see if the URLs of favorites/bookmarks are still good. The problem I am having is that while the...
7
by: Emanuel Ziegler | last post by:
Hello, I want to do some mathematics with functions. In my case the function classes are very complex, but this simple example has the same problems. To allow calculations that begin with a...
5
by: NathanV | last post by:
Anyone familiar with Delphi know of a similar type to the TStringList in C#? Thanks, Nathan
78
by: Josiah Manson | last post by:
I found that I was repeating the same couple of lines over and over in a function and decided to split those lines into a nested function after copying one too many minor changes all over. The only...
0
by: sklett | last post by:
I'm pretty new to Isolated Storage and have run across a problem. I'm serializing a PageSettings object and storing using Isolated Storage. When trying to load the PageSettings I'm getting a...
1
by: Xoomer | last post by:
How to out everything from TStringList MyList? Example: TStringList* MyList = new TStringList(); MyList->Add("1..."); MyList->Add("Two....."); MyList->Add("this is three"); MyList->Add("now...
5
by: jbenner | last post by:
I have opened a PMR for this with IBM, and am not asking for advice from the DB2 DBA community. I am posting this as an FYI that DB2 Health Monitor, even at the latest version of DB2, still can cause...
23
by: Stewart Berman | last post by:
I am trying to develop a wrapper class for the Windows API functions in Visual Studio 2008: GetOpenFileName GetSaveFileName I put together a starter class: using System; using...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.