|
Hello all,
What in your collective opinions would be the best way to recursively search a users's hard drive for files given that there are multiple files to search for and all this needs to be done in one operation?
I can use CFileFind to search the HD for 1 file, then re-do the search again for file 2, and so on and so forth, but...this could take years on large HD's...or is this the way to go?
Anyone, anyone, Bueller?
Frank
|
|
|
|
|
Just FindFirstFile & co. and do the regexp'ing yourself from the returned filenames.
|
|
|
|
|
Eureka!!! The eagle has landed.
Thanks, Mike. Sometimes you just need a little input to get you going back in the right direction again.
Again, many thanks.
Frank
|
|
|
|
|
Hi,
I am trying to use the MFC socket classes in a client/server app I am working with. How can I determine when a CSocket has data to be read, and I can call Receive? I am waiting for messages from a client on this socket. I do not want to use a windows message (AsyncSelect), but I find no EventSelect method in the CAsyncSocket class to parallel the WSAEventSelect function.
I tried using WSAEventSelect driectly, with the SOCKET handle encapsulated by the CAsyncSocket class, but ran into struct redefinitions and other include problems, because I was including both afxsock.h and winsock2.h, but if winsock2.h is not included, all of the WSA??? stuff is undefined. Has anyone tried something similar? I would like to have the flexibility of the raw WSA functions, with the encapsulation of the MFC socket classes. It seems MS chose not to wrap all of the winsock API in MFC, but seems like they intend these to be used with the CSocket/CAsycnSocket classes, since the socket handle is accessible to client code.
Thanks,
Aaron
|
|
|
|
|
This is not too elegant a solution, but you can try adding a CEvent member to your CAsyncSocket -derived class and signalling it in OnReceive .
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Not quite, but thanks for the advice. Actually, I am trying to use raw winsock functions with the MFC socket classes, but the includes are messing me up.
Anyone else done something like this? I had originally started out writing my own wrapper class for the socket functions, but thought it would be better to use MFC's classes if possible.
|
|
|
|
|
The function CAsyncSocket::OnRecieve will be called by the framework when CSocket has data to be read. Just derive your own class from CSocket and overload this function. Whenever it's called there is data to be read, and you can do whatever you want, like call another function to take care of the reading. Use the CAsyncSocket::Recieve function to read the data.
Sprudling
|
|
|
|
|
I want to read CD_Rom's Label in my CD drive when windows start and if it is the right CD I want to execute an .exe file. How can I do this? Thanks right now
Kemal ÖZLÜ
|
|
|
|
|
When "windows start", or when a user logs in?
Anyway, add your exe to HKLM/.../RunOnce. Make your exe enumerate the CD-ROM devices on your system (if you only want drive-letter-mapped devices use GetLogicalDrives(), if not you need to use FindFirstVolume() & co. - it depends on the target OS). CheckDriveType() and then GetVolumeInformation() to get the label. There are then a few different ways to start the target exe: CreateProcess(), ShellExecute() and system() comes to mind.
|
|
|
|
|
Hello
I was wondering if there is a kind soul out there who would be willing to help me out ?
I am currently undertaking C++ market research and need to find out statistics on the most commonly used libraries.
Does anyone have any such data or know where I might find it ?
Look forward to hearing from kind souls soon
|
|
|
|
|
The most commonly used type of C++ library is the standard C++ library provided with any C++ implementation (even that there still are no such implementation available - a few comes close though).
Out of those I'd say there is no dubt that the most widely commercially distributed (and possibly also used) are different versions of the Dinkumware library, since Dinkumware is the vendor of the libraries shipped with the different versions of MSVC.
For free libraries I'd expect STLport to be the #1 C++ library both used and distributed. You should probably also consider counting the GNU C++ library.
|
|
|
|
|
Mike
Thank you for getting back to me. I most appreciative of the information.
|
|
|
|
|
I salute you all,
How can i make MS Paint's Curve EXACTLY?
|
|
|
|
|
Since it is a Bezier curve, I'd suspect PolyBezier would do it.
|
|
|
|
|
MSPaint draws cubic Bézier curves with two end points and two control points. See <a href="http://msdn.microsoft.com/library/en-us/gdi/linecurv_2d2q.asp?frame=true">PolyBezier</a> for details.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
I want to develop an application about memory in VC++6.0, but I have no idea on how to get files name in memory, anyone can help me for that? Many thanks
|
|
|
|
|
What do you mean by "get the file name in memory"? Could you please ellaborate?
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
I want to display top 5 files memory use in my win2k system. Do you know how can I get the file name in memory directory through VC function or windows API? Thanks again.
|
|
|
|
|
Excuse my poor understanding, but what does "top 5 files memory use" mean? Remember it can make a lot of sense to you but makes little as an out-of-context question.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
well....that is my definition for my application. That means the largest 5 files which are used in the memory.
|
|
|
|
|
I think he means he wants to determine the top 5 currently running .exes that are using the most memory. Looks like time for toolhelp.dll.
/ravi
"There is always one more bug..."
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
Do you have any idea with that?
|
|
|
|
|
Hi there!
How do I force my Slider's OnCustomdraw() to be called from an OnMouseMove()?
I've added a second thumb to the default slider control. When moving the mouse the second thumb isn't draw/erased until the mouse button is erased.
Also tried from within OnMouseMove() the following:
GetClientRect( &rc );InvalidateRect( rc );UpdateWindow();
Doesn't work...
Thanks!
Martin.
|
|
|
|
|
I am trying to write my own class CDisplayPrintTemplate which is derived from CFormView. This FormView works fine on its own, but the following lines cause problems when i try to create a new class based on my CDisplayPrint Template:
// CDisplayPrintTemplate.h
public:
enum { IDD = IDD_DISPLAY };
it compiles and works unless i include the file and try to use it as a base for another class.. i tried getting rid of this completely, but then i error on the constructor because there is no blank constructor:
// CDisplayPrintTemplate.cpp
CDisplayPrintTemplate::CDisplayPrintTemplate()
: CFormView(CDisplayPrintTemplate::IDD) // < here
{
is there a way to use my CFormView based class as a base for other classes?
thanks in advance!
-dz
|
|
|
|
|
i guess i should mention that the error i get when it is included is:
"'IDD_DISPLAY': undeclared identifier"
again, i don't get this error when i use the class on its own, only when i try to base a class off of it and the file is included.. IDD_DISPLAY is the form from the dialog editor
-dz
|
|
|
|