Article View: borland.public.cppbuilder.nativeapi
Article #5666Re: Drag 'n Drop of a folder (with textfiles) into a ListBox - confuse effect...
From: Remy Lebeau (TeamB)
Date: Tue, 02 Aug 2005 00:52
Date: Tue, 02 Aug 2005 00:52
54 lines
2628 bytes
2628 bytes
"Oren Halvani" <xx@xx.com> wrote in message
news:42eebf1b@newsgroups.borland.com...
> the OnClick, OnDoubleClick, OnKeyPress and other Events
> are not working at all...WHY???
That would suggest that those messages are no longer reaching the ListBox at
all.
I cannot reproduce the problem, though. Everything works fine when I try
your code. You need to come up with a more specific test case that reliably
reproduces the problem.
> what is wrong here again...? i know the problem is in the
> while loop but can someone describe it to me so i can fix it...?
Although not related to any looping problems persay, there are other
problems with your code:
1) you are still relying on the WM_DROPFILES message to begin with. You
really should be using OLE Drag&Drop instead.
2)
> String filename = caFileName, wildcard = "\\*.*", strResult =
filename + wildcard;
>
> char const * Result = strResult.c_str();
Why are you doing all of that? You could just construct the AnsiString
directly in the call to FindFirst():
int result = FindFirst(IncludeTrailingBackslash(caFileName) + "*.*",
...);
3)
> int result = FindFirst(Result, faAnyFile ^ faDirectory,
searchRecord);
You should be using the '&' and '~' operators instead:
int result = FindFirst(..., faAnyFile & ~faDirectory, ...);
4)
> if(IsAscii(caFileName)) // is it a text-file..?
Look very closely at that line. Notice anything peculiar? You are passing
the original folder name to IsAscii() instead of the filename that
FindFirst/Next() gives you:
if( IsAscii(searchRecord.Name) )
Gambit
Technical Details
Message-ID:
<42eec485$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news.glorb.com!news.moat.net!news-out.newsfeeds.com!propagator3-LAX.newsfeeds.com!news-in.spamkiller.net!news-in.superfeed.net!caladan.landsraad.net!newsgroups.borland.com!not-for-mailReferences:
<42eebf1b@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,d5e6340a5f435d04 X-Google-Attributes: gid10cc67,public X-Google-Language: ENGLISH,ASCII-7-bit From: "Remy Lebeau \(TeamB\)" <no.spam@no.spam.com> Newsgroups: borland.public.cppbuilder.nativeapi References: <42eebf1b@newsgroups.borland.com> Subject: Re: Drag 'n Drop of a folder (with textfiles) into a ListBox - confuse effect... Date: Mon, 1 Aug 2005 17:52:05 -0700 Lines: 56 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1409 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409 NNTP-Posting-Host: 68.69.17.41 Message-ID: <42eec485$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1122944133 68.69.17.41 (1 Aug 2005 17:55:33 -0700) Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news.glorb.com!news.moat.net!news-out.newsfeeds.com!propagator3-LAX.newsfeeds.com!news-in.spamkiller.net!news-in.superfeed.net!caladan.landsraad.net!newsgroups.borland.com!not-for-mail