473,467 Members | 1,307 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

how to implement the CFileFind class in c++

bajajv
152 New Member
Hi,
I was trying to implement the functions of CFileFind class in c++. Can anyone give some hint how it can be done? Didn't find anything relevant on the net.

Thanks,
Nov 20 '09 #1
6 5426
RRick
463 Recognized Expert Contributor
CFileFind is part of MFC and MFC is based on C++, isn't it?

If you don't want to use MFC, some people suggest using the Windows API routines instead. These could be encapsulated in a C++, but you'll have to write it yourself. Try this link: http://"http://www.codeguru.com/foru...php?t=372515"]
Nov 20 '09 #2
bajajv
152 New Member
@RRick
I dont want to use anything specific to any OS. Can we implement it such that it runs on every OS? Does c++ have something for this?
Nov 20 '09 #3
Banfa
9,065 Recognized Expert Moderator Expert
On, that is because different OS use different filing systems (in fact the same OS can use different filing systems) so there is no standard way to access the directory structure.

Different OS do not even have the same method of specifying directories, i.e. Windows uses \ and Linux/Unix / as the directory separator. There is no standard way to enumerate directories/directory contents in C++ (or C).

However if you are using C++ I would go and look at the boost libraries, I don't know if they have a solution but those guys have solved many problems of this nature.
Nov 20 '09 #4
mac11
256 Contributor
@Banfa
Boost does indeed have a portable solution for filesystems.
http://www.boost.org/doc/libs/1_41_0.../doc/index.htm
Nov 20 '09 #5
bajajv
152 New Member
@mac11
dont have the option of boost either. trying with opendir() and readdir().
Nov 21 '09 #6
bajajv
152 New Member
hi,
Can we implement the FindNextFile() function of CFile class from MFC by standard c++, (without using boost)? Any functions from standard c++ which will help in this case
Nov 22 '09 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: Charles Law | last post by:
This is going to seem like a basic OO question, but it comes up and bites me every now and again. Suppose we have a multi-tiered protocol to implement, what is the logical, OO way to design the...
2
by: Billy Porter | last post by:
Greetings, I got a class that wraps the System.Data.SqlClient.SqlConnection class (no COM interaction). I'm not sure if I'm supposed to implement the IDisposable pattern for this wrapper or not....
4
by: Peter | last post by:
I want to copy a parent class instance's all datas to a child's. It's actually a C++'s copy constructor. But why the following code does not work - there is a compile error! How it should look...
3
by: Erik Harris | last post by:
I apologize if this is a stupid question - I'm relatively new to OOP. I have a property that must exist in a class in order to be used by another class. The property, however, does not change with...
1
by: theburnetts | last post by:
I have a complex class heirarchy where all of my classes inherit from a single base class (BaseObject) and this BaseObject class inherits from XPBaseObject. XPBaseObject is a 3rd party base class...
7
by: moondaddy | last post by:
If I'm in a class that inherits an interface, is there a shortcut key that will write the implementation of the interface into the class? I remember seeing something like this in vb.net. ...
0
by: emin.shopper | last post by:
I had a need recently to check if my subclasses properly implemented the desired interface and wished that I could use something like an abstract base class in python. After reading up on metaclass...
52
by: Ben Voigt [C++ MVP] | last post by:
I get C:\Programming\LTM\devtools\UselessJunkForDissassembly\Class1.cs(360,27): error CS0535: 'UselessJunkForDissassembly.InvocableInternals' does not implement interface member...
5
by: Tony Johansson | last post by:
Hello! Assume you have the following interface and classes shown below. It is said that a class must implement all the methods in the interface it inherits. Below we have class MyDerivedClass...
0
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
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
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
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
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.