Join
Sign in
Search Options
Search Everything
Search Development Tools
Home
Blog
Resources
Forums
About Open XML
More ...
Home
»
Forums
»
Development Tools
»
C/C++
»
Finding all doc or docx files in a directory
Finding all doc or docx files in a directory
Development Tools
Discussions about working with Open XML using a wide range of development tools
Get this RSS feed
Details
2
Replies
1
Subscriber
Posted
over 5 years ago
Options
Subscribe via RSS
Share this
C/C++
Finding all doc or docx files in a directory
rated by 0 users
This post has
2 Replies |
1
Follower
janverley
65
Posted by
janverley
on
Fri, Feb 15 2008 10:13 AM
rated by 0 users
Post Points: 20
Finding all doc or docx files in a directory
Not an OOXML issue, but an issue we encountered when integrating Office 2007.
For our application - written in C++ - we need to list all *.doc files in a given folder
(in case the user chooses
not
to work with the new OOXML fileformat).
The File management Functions
FindFirstfile
,
FindFirstFileEx
and
FindNextfile
seem to work with short filenames: "test123123.docx" is seen as "TEST12~1.DOC"
Thus: specifying "C:\temp\*.doc" as
lpFileName
, lists
both
.doc
and
.docx files in that directory.
Does anybody know a "good" solution for this problem?
FindFirstFileEx
doesn't do it any better than
FindFirstFile
.
At this moment, we use string comparisons afterwards to filter out all files that don't fit the query.
Thanks in advance!
Jan Verley
mcohen20
25
Posted by
mcohen20
on
Fri, Sep 18 2009 10:01 AM
rated by 0 users
Post Points: 20
Re: Finding all doc or docx files in a directory
Have you come across a solution to this?
janverley
65
Posted by
janverley
on
Wed, Sep 30 2009 2:05 PM
rated by 0 users
Post Points: 5
Re: Finding all doc or docx files in a directory
No,
But I found this
http://blogs.msdn.com/oldnewthing/archive/2005/07/21/441330.aspx
And the comments are helpfull:
"just suck all the results from FindFirstFile into a std::vector and do whatever the hell you like with it afterwards"
The behaviour I was looking for can indeed be regarded as an "API dependecy".
Good luck!
Page 1 of 1 (3 items)