|
I'm writing a program that will search for files. So I let the user pick the starting drive or path and the file name (the file name can have a wild card in it) example path = c:\ filename = doc.t*. I string them together and pass this to the findfirstfile api. If nothing matches the filename then it errors out with and invalid handle. So how do I make it go to the next directory under that path to find the file? Or how do I make it keep searching for the file until it finds it and returns the path to me?
Thanks
Tom Wright
tawright915@yahoo.com
|
|
|
|
|
|
I'm not looking for a class that I can include into my program. I just wanted to know how it's done.
Thanks
Tom Wright
tawright915@yahoo.com
|
|
|
|
|
You need to get the list of subdirs in the current dir, then recursively call your function (which ends up searching for
files and subdirs). Functions like these usually have signatures
of the type:
void findFiles
(CString strWildcard,
CStringArray& listOfLocatedFiles,
bool bRecurse)
/ravi
Let's put "civil" back in "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
Hello
I have figured out how tome make the changes to the SPDemo program on this site. http://www.codeproject.com/splitter/SimpleDlgSplitter.asp
However, when I went into the ResourceView tab and clicked on Dialog I wanted to remove one of the three windows. I deleted the top right window and it complied fine. But when I try to run it I get this error.
"Debug Assertion Failed"
"Program: ...\Microsoft Visual Studio\My Projects\SPDemo\Debug\SPDemo.exe"
"File: dlgdata.cpp"
"Line: 43"
This file is part of the MFC library and that line in that file is "ASSERT(FALSE)"
What does this mean and how can I fix it?
Thanks
Scott
|
|
|
|
|
Hi
Here is my problem.
I am programming in Win32. I create a window that contains a treeview window child :
hTV = CreateWindow(
WC_TREEVIEW,
NULL,
WS_CHILD | WS_VISIBLE | WS_VSCROLL | WS_HSCROLL | WS_CAPTION |
TVS_HASBUTTONS | TVS_HASLINES | TVS_LINESATROOT | TVS_EDITLABELS ,
rect.left,rect.top,rect.right/4,rect.bottom/2,
hwnd, // parent window
NULL,
(HINSTANCE) GetWindowLong(hwnd, GWL_HINSTANCE),
NULL);
It works well except that instead of having the whole background of the treeview as white (which is I think the default color), the background of the "decoration" stuff (lines at root, lines, buttons) of the treeview is gray.
I would like to have it all white.
Would someone know how to do that ?
Thanks in advance for help
Ben.
|
|
|
|
|
I have to develop an application having a not easy
User Interface.
I have to show serveral panels in the MainFrame
(not at the same time) and I have to change the
MainFrame structure according to the panel shown inside
it (in some cases I have to show and manage a splitter,
in other cases I need the whole MainFrame).
How can I solve this problem ?
I've tried to create a MDI application and I have
registered some tamplates as shown in the following
code.
AddDocTemplate(new CMultiDocTemplate(
IDR_LANGUATYPE,
RUNTIME_CLASS(CLanguageProblemsDoc),
RUNTIME_CLASS(CChildFrame), // custom MDI child frame
RUNTIME_CLASS(CLanguageProblemsView)));
// Form Rilevamento dati
AddDocTemplate(new CMultiDocTemplate(
IDR_RILEVAM_DATI,
RUNTIME_CLASS(CLanguageProblemsDoc),
RUNTIME_CLASS(CSplitterFrame),
RUNTIME_CLASS(CRilevamentoDatiView)));
I have made this choice in order to have different
templates to create and show when I want.
(I'm not sure that this is the rigth way to solve my problem).
Now the problem is that I don't know how to select the
appropriate template to create and I don't known how
to switch from a document to the other one (all by code).
Can someone help me ??
Thanks a lot !!!
|
|
|
|
|
When I exit the modal dialog should I call EndDialog(IDOK) or CDialog::OnOK(). From what I am understanding either is fine....
It seems that with neither call is the modal window destroyed. Is this a bad thing? Because in the CP modeless article I see that they destroyWindow a modeless dialog> Why dont we need to destroyWindow a modal dialog?
Appreciate your help,
ns
|
|
|
|
|
|
Thank you for the reply. But now I am curious: why not? Sorry to further bother you....;)
Appreciate your help,
ns
|
|
|
|
|
In DLGCORE.CPP u can find in the implementation of DoModal
// destroy modal window
DestroyWindow();
PostModal();
MSDN says for EndDialog "it sets a flag and allows the dialog box procedure to return control to the system. The system checks the flag before attempting to retrieve the next message from the application queue. If the flag is set, the system ends the message loop, destroys the dialog box"
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
Thank you. Its so odd.if I do google on EndDialog it takes mt to a more informative microsoft site than just searching in help in the dev environment....
The info you gave me wasnt in my local msdn help...
Appreciate your help,
ns
|
|
|
|
|
That is misleading because MFC creates all dialogs as modeless and manually disables/enables the dialog's parent as appropriate.
--Mike--
THERE IS NO THERE IS NO BUT THERE IS
MAGIC PIXIE DUST BUSINESS GENIE CODE PROJECT
Homepage | RightClick-Encrypt | 1ClickPicGrabber
"You have Erica on the brain" - Jon Sagara to me
|
|
|
|
|
ns wrote:
Thank you for the reply. But now I am curious: why not? Sorry to further bother you....
Hello ns,
It was you who got me started on this article :-
http://www.codeproject.com/dialog/notmodaldialogs.asp
Regards.
Nish
Author of the romantic comedy
Summer Love and Some more Cricket [New Win]
Review by Shog9
Click here for review[NW]
|
|
|
|
|
Hi!
I have problems with method SetOptions.
When I call SetOptions(ECOOP_OR, ECO_SAVESEL ) and CRichEditCtrl has no text some styles for this controls simply are disappearing (like ES_AUTOVSCROLL).
But when I type some text everything is OK.
Any help?
P
|
|
|
|
|
I have numerous word documents that I need to email to several different people. The first line in the word document contains the email address that the document is supposed to be sent to.
Is there any way that I can take this document and parse it so that I can get this information and then send an email to the address that was taken out of it?
|
|
|
|
|
Use Word.Application COM object.
Sergiu.
|
|
|
|
|
I want to read character by character from a text file and want to match each character to a certain criteria.
Moreover I want to reach certain points or certain data in the file. Plz provide me with datails how to do so.
I am totally blank in filing so Plz provide me with details instaed of just mentioning the function names.
Reply me soon
|
|
|
|
|
Working in MFC, I want my program to send an email message automatically on certain addresses after the satisfaction of some criteria. I am a beginner in VC++, so provide me with relevent APIs/sites/codes to fullfil this task.
Plz suggest me the easiest way of doing so.
Reply me soon
|
|
|
|
|
Solutions depend on your design and tools. For example, what socket tool do you want to implement, i.e. pure winsock or MFC's CSocket? Deside on a socket design and then we move from there.
Kuphryn
|
|
|
|
|
Actually I want to attach this email code with a code I am already using for sniffing packets. In that I am using raw sockets of Winsock api. But I feel that MFC's CSocket would be a better chice to be used.
Plz provide me further info. on it and plz keep in mind that I am a beginner and does not have much knowledge in VC++. So kindly try to suggest me the easiest ways of doing so.
Reply me soon
|
|
|
|
|
|
You can find some wrapper classes at www.naughter.com
you can use those classes for sending e-mails
Wish u good luck
--Kamesh
|
|
|
|
|
i would like, that my addin makes a new menuitem just right to "Tools" which is called "MyAddins" (so i can find my addin there and not under tools (default))
how can i do this?? it is nowhere documented!!
or is there another way to make this menu? by changing something in the registry maby? i didnt found out, please help me, thanx!
|
|
|
|
|
Hi ,
How to merge resources developed in differnet project work spaces??
I tried with
Open source work space ->select dialog, Edit->copy,
Opened target workspace -> Edit paste. But i could copy only dialog, but not associated .h and .cpp files and member varables.
Any suggessions
Thanks in advance
--Kamesh
|
|
|
|