473,498 Members | 1,557 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

problem with function "_tfindfirst()"

HI, ALL
I found a surprising problem when using function "_tfindfirst()" and
"_tfindnext()" to enumerate all the files in a specified directory, the code
is like below:

handle = _tfindfirst(searchdir,&filefind);
if (handle != -1)
{
do
{
// if (_A_SUBDIR != filefind.attrib)// is a jar file
{
_tcscat(destParams, jarPath);
_tcscat(destParams, _TEXT("\\"));
_tcscat(destParams, filefind.name);
_tcscat(destParams, ";");
}
} while (0 ==_tfindnext(handle,&filefind));
}
else
{
LOG("Cannot find the jar files from search path below");
LOG(searchdir);
}
_findclose(handle);

this code piece will be executed twice in my program, and in the first pass,
it works well, however, it fails in the second pass. and the searchdir is
the same one and the target directory is kept intact, i don't know why this
happens, could you have any suggestions?
--

Best Regards

Liang Zhang

Developer
SAP Labs China

T: +86 21 61006699-7775
F: +86 21 65984520
Email li*********@sap.com

SAP LABS CHINA : INNOVATE THE FUTURE
May 10 '06 #1
1 3136
Liang Zhang wrote:
HI, ALL
I found a surprising problem when using function "_tfindfirst()" and
"_tfindnext()" to enumerate all the files in a specified directory, the code
is like below:


http://www.parashift.com/c++-faq-lit...t.html#faq-5.9
Jonathan

May 10 '06 #2

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

Similar topics

5
7731
by: asim | last post by:
Hi if a declare a variale say Dim Flag and assing it to true a boolean value Flag = True and if i try to concatinate it with another string like mystr="<my-str>" & Flag & "</my-str>" and if...
1
1620
by: fig000 | last post by:
Hi, I have some code written into the html in a dot.net form: <%if test(Container.DataItem("user_id")) =2%> I've been able to use container.dataitem in these <%%> pairs as an expression to...
1
2821
by: Lewap | last post by:
Hi! I have a problem: Function CreateNamedPipe (a piece of source below) called in a NT service I get an error 997 - Overlapped I/O operation is in progress. When I run the same code as...
0
1138
by: papigreg | last post by:
Hi, I have made a Windows Forms .Net Project in C++. I use the Philips Speech SDK to make voice recognition on WAV files. In the recognition function, I must pass a pointer of a function which I...
21
1765
by: Mike | last post by:
I am having a problem getting AND to work. I have a MySQL database field defined as varbinary(8) with X00 in it. Then I have define statements with X01 in it. define('CERTACCESS_MEDALS', x01); ...
5
1524
by: dost | last post by:
as in a class private section we can access the private data member in main through the pointers...is their any way to access the member functions which are written in private section..... ...
9
5693
by: lev | last post by:
Attempting to use javascript's regular expression methods to match a particular lab number and building which would then be copied to a pair of textfields, I found that general matching characters...
1
1600
by: john.swilting | last post by:
I am not good in Javascript I begin I do not understand why my function does not go I post my code <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">...
4
2897
by: poojak | last post by:
I have write two different js function in a external file. one function write a table (I used innerHTML for this.) and another function is for showing/ hideing some rows depending on radio button...
3
1645
by: ziycon | last post by:
The below function works properly when the its called by: storeExtraImages("n","news",1); But when called by these next two line's it gets to if(move_uploaded_file($_FILES,...
0
7126
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7005
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7168
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
6891
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7381
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
4916
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4595
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3087
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
659
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.