|
 |
|
|
Hi Louka,
i just found your code and it fits exactly to what i was looking for ! Thank you very much ! So i do not need to do things again that others already did ...
Greetz Uwe
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
Hi,
I have tested the class and found it easy to use and working correctly. There is only one thing i have found to be the problem, at least in my case. I have files with same extension but in different character cases. For example: MYFILE_1.txt and MYFILE2.TXT Although I can specify m_opts.filter = "*.txt;*.TXT" to get both files in result set, it seems a bit impractical to put into filter all possible user inputed combinations like: *.TxT;*.txT etc.
It would be nice if case sensitive/insensitive option is added to struct FindFileOptions_t and handled in the code.
Gugy
|
| Sign In·View Thread·PermaLink | 3.00/5 (1 vote) |
|
|
|
 |
|
|
The short story is I get 1>C:\Program Files\Microsoft Visual Studio 8\VC\include\crtdbg.h(970) : error C2059: syntax error : '('
Why I get his message is beyond me.
Further research show that C2059 can be caused by a number of passing a structure type problems example Another specific reason you can get C2059 is when you compile an application that specifies a structure in the default arguments for a function. The default value for an argument must be an expression. An initializer list, such as that used to initialize a structure, is not an expression. The resolution is to define a constructor to perform the required initialization.
Does anyone know how to fix this and get the fixes posted here for other users? A google search Louka Dlagnekov shows him at UCSD - University of California at San Diego Louka, if you read this, thanks, and have you thought about a way to keep this updated. I use this in a global search and replace for large amounts of text between two tags.
The error details are here
>Compiling... 1>FindFile.cpp 1>C:\Program Files\Microsoft Platform SDK for Windows XP SP2\Include\specstrings.h(334) : warning C4005: '__reserved' : macro redefinition
.... ... 1> C:\Program Files\Microsoft Visual Studio 8\VC\include\sal.h(500) : see previous definition of '__in_ecount' 1>C:\Program Files\Microsoft Platform SDK for Windows XP SP2\Include\specstrings.h(358) : warning C4005: '__inout_ecount' : macro redefinition 1> C:\Program Files\Microsoft Visual Studio 8\VC\include\sal.h(528) : see previous definition of '__inout_ecount' 1>C:\Program Files\Microsoft Platform SDK for Windows XP SP2\Include\specstrings.h(359) : warning C4005: '__out_bcount' : macro redefinition 1> C:\Program Files\Microsoft Visual Studio 8\VC\include\sal.h(510) : see previous definition of '__out_bcount' 1>C:\Program Files\Microsoft Platform SDK for Windows XP SP2\Include\specstrings.h(360) : warning C4005: '__in_bcount' : macro redefinition 1> C:\Program Files\Microsoft Visual Studio 8\VC\include\sal.h(501) : see previous definition of '__in_bcount' 1>C:\Program Files\Microsoft Platform SDK for Windows XP SP2\Include\specstrings.h(361) : warning C4005: '__inout_bcount' : macro redefinition 1> C:\Program Files\Microsoft Visual Studio 8\VC\include\sal.h(529) : see previous definition of '__inout_bcount' 1>C:\Program Files\Microsoft Visual Studio 8\VC\include\crtdbg.h(970) : error C2059: syntax error : '(' 1>C:\Program Files\Microsoft Visual Studio 8\VC\include\crtdbg.h(974) : error C2059: syntax error : '('
|
| Sign In·View Thread·PermaLink | 2.00/5 (1 vote) |
|
|
|
 |
|
|
 |
|
|
 |
|
|
Hi there,
Would it be possible for you to please email me the zip file with the source code? code project's website download button doesn't seem to have the file available. email:eck@tuks.co.za
I'd be very thankful if u could send it to me, kind regards Eckhard.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
Hi, I'm programming a client server with sockets and i need that the server sends mea message with the list of all the files and folders of c:\ and i wrote in other thread and the people told me that i have to look this project but i'm no very good programming with vs6 and c++ i'm little bit new and i'm cheking this program but i have a link error in the beggining "FindFile error LNK2019: unresolved external symbol _main referenced in function _mainCRTStartup" and i don't know why, i have read the article and i don't know where i have to inizializate the settings.
Can somebody help me?
Thank you so much
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
I don't know how you've set up your VS project, but it sounds like none of the source files in your project have a main() function, which is the entry point of all programs. Keep in mind that the source files in this article don't form a stand alone program; you need to be calling its functions from some sort of a driver program.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
I'm only cheking your program and i'm inizializated like you say in the article in FindFile.cpp in the begining FindFile but when i build, visual studio show me this error "FindFile error LNK2019: unresolved external symbol _main referenced in function _mainCRTStartup", and i don't know why.
Thanks /densitet
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
error LNK2001: unresolved external symbol "__declspec(dllimport) public: void __thiscall _STL::allocator::deallocate(char *,unsigned int)const " (__imp_?deallocate@?$allocator@D@_STL@@QBEXPADI@Z)
I'd got this error, do you know why?
only with this filefind library, this happen
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
Perhaps this discussion can help:
http://crayzedsgui.sourceforge.net/modules.php?name=Forums&file=viewtopic&t=93
Louka
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
the web page was relly helpful.. now it works well.. Thanks your info..
something _DEBUG flag fix the problem..
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
Is it possible to search all of a computers hardrives without knowing the drive letters, example my one computer has only one drive (C:\) and my desktop has two drives (C:\ and F:\). So i want to specify one location like a wildcard or something so that it will search all hardrives whether it be one or many drives?
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
CyberJay82,
You could call GetLogicalDrives() which returns a bit mask that has a bit set for each logical drive on the machine. If the highest order bit is set it means there's an A:\, if the next highest order bit is set, there's a B:\, etc. Then you can call GetDriveType() on each such drive and check the return value against DRIVE_FIXED to determine whether it is a hard disk.
There's a detailed article on how to do this here:
http://msdn.microsoft.com/msdnmag/issues/04/01/CQA/default.aspx
Louka
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
Louka,
As you mentioned in the introduction, you've found the solutions, which are IDE dependent (VS or MFC), for the same task of file find. Would you share your findings and source codes?
Thanks in advance.
Alan Phang SP
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
Alan,
The code that is posted on this page is, in fact, IDE independent. You can compile it with VS, Borland C++/Borland C++ Builder or some other Windows IDE and it will work.
Louka
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
Hi, Does anyone know how to use the windows search api to search for a WORD or phrase in files. Is there any sample code or snippets that could help me do this.
Thanks, Gav.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
Gav,
You will need to process each found file on your own to determine whether each matches the desired word/phrase. Just open each file, read sections into a buffer and search for the word in the buffer. It gets a little tricky if part of the word matches the end of the current buffer. If that happens, you'll need to try a match with the beginning of the second buffer.
Cheers,
Louka
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
Hi,
the program does find files that contain "Umlaute" (äöü) but it never finds any files if the path contains an Umlaut. I found out that the problem is with the FindFirstFile/FindNextFile commands. Anyone any idea what I can do?
Tobias
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
Hi,
I guess there's bug in the code: pattern du* matches all files and directories starting with d.
In addition, it always finds files starting with hyphen, but I guess that's not so terrible...
Does anyone have a fix for the first one?
-- LePo 
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
Hi,
maybe you should use PathMatchSpec() declared in Shlwapi.h instead of the home made wildcard class.
DS
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
Louka,
Just wanted to say thanks for writing and releasing this. It works great (with the small fix mentioned above).
Thank you,
Joe
-= Joe McConnell =-
|
| Sign In·View Thread·PermaLink | 1.00/5 (1 vote) |
|
|
|
 |
|
|
Hi, When I run the program, I do not get complete results. for example, if I run the program searching on "C:\\" for "*.txt" files.....I have a folder labeled "aab" (for testing purposes) that contains text files that the program does not find. The program skips over this folder everytime instead of finding it first. any ideas on this one?? I love this program though, it is very useful! I've been trying to debug this error, but I can't figure it out.
thank you in advance for any help
Alex
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
Alex,
Indeed, there is a bug when searching for files in the root drive (like C:\, A:\, etc). Take a look at the post below (http://www.codeproject.com/file/Win32FindFile.asp?select=417695&df=100&forumid=13624#xx417695xx) by Mr. X. That should do it.
Louka
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
Thank you for your quick response. I tried that solution before creating my post and all it did was put my program in an endless loop. any ideas why this would happen??
|
| Sign In·View Thread·PermaLink | 2.00/5 (1 vote) |
|
|
|
 |