|
hi!
u use CStdioFile which is a derived class of CFile. this class has
BOOL ReadString(CString str) ; function, which reads one line per call. u can refer them in MSDN. This should certainly help u. Similarly u have WriteString also, which writes one line each time. i think File size was already answered. CString class has so many functions which will be useful for u to find some delimiter and many other operations...
when going gets tough the tough gets going
|
|
|
|
|
Hi Buddies Please Tell me is there API or any Class which can get all files from a Folder ???.
|
|
|
|
|
CFileFind , FindFirstFile() & FindNextFile()
Sonork 100.11743 Chicken Little
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
Within you lies the power for good - Use it!
|
|
|
|
|
CFileFind
-Steven Hicks
CPACodeProjectAddict
|
|
|
|
|
How can I know the name of functions & its Parameters of Unknoun DLL file ?
Iman Ghasrfakhri
|
|
|
|
|
One solution is to win32 system program such as dumpbin.
c:\winnt\system32\dumpbin -exports unknown.dll
Kuphryn
|
|
|
|
|
functions: use Dependency Walker
parameters: you can't, unless you have a header-file with the function declarations
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
Greg S. wrote:
parameters: you can't, unless you have a header-file with the function declarations
You can dissasemble the function and find the parameters it accepts . Surely it will be a last resort, but if you can't get the function spec...
"semper aliquid haeret", Bacon.
-- Sebastián.
|
|
|
|
|
Hello all.
I am just playing around with Visual C++ 6.0 lately. I have simple code right now and all it does is read a 350K text file (with fgets) and looks for certain strings in that file and adds them to a listbox.
I noticed that when I run the program (without a progressbar) it takes about ~1 second to complete. However, as soon as I implement the progressbar, it takes about 3 seconds to complete for a non-smooth bar, and about 10 seconds to complete for a smooth bar.
I've tried two methods of updating the progressbar. The first was I just use SetPos() so I tried using SetStep() and StepIt(). Both of these methods dramatically slow the program down. If I take comment out the SetPos()/StepIt() methods and run the program again, it is blazing fast.
I am wondering if anyone knows how I can somehow speed up this process or maybe I am doing something wrong which is causing it to run slower, or is that just the nature of using a progress bar? I really want to have a progressbar in there for the bigger files that I am going to read, just because it looks cool. But in my program, it will eventually read 100's of files and parse through them, so the 5 seconds here and there will really matter. Any ideas on how to speed this up would be appreciated!
Shultas
|
|
|
|
|
Any drawing that is done on the screen will slow a program down, so I would think the best way to speed the program up is to update the progress bar less often, step it every 100K instead of every 10K so your 350K file would only redraw the progress bar 4 times instead of 36 times.
Sonork 100.11743 Chicken Little
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
Within you lies the power for good - Use it!
|
|
|
|
|
In all honesty, at first I thought that this method would make the progress bar look somewhat "choppy", but I gave it a try anyways.
PERFECT results!
I did a check of how many times the While() loop was getting executed. Over 39,000 times. So I guess you could say that 39,000 calls to the SetPos would indeed slow the program down .... I just put a lil helper variable in there and called it every 2,000 passes and it blazes perfectly fast just like it did when there was no progress bar at all.
Thanks very much for your help. Just a dumb little thing like that I spent a solid hour trying to figure out what the problem was! I guess if you call SetPos(1000) ... SetPos(1500) ... SetPos(2000), out of 39000 tries, between 1000-1300 is the same bar (meaning the progress bar never gets updated to add another bar to it between those numbers), but when you call SetPos() it appears that it still takes some processor time (even though the bar never physically changes).
Thanks again!
|
|
|
|
|
shultas wrote:
when you call SetPos() it appears that it still takes some processor time (even though the bar never physically changes).
SetPos() eventually calls SendMessage() which results in a call to the progress bar's window procedure, which handles the message and undoubtedly calls RedrawWindow() , which results in a WM_PAINT being sent to the progress bar, which again calls the progress bar's window procedure, which then does various GDI calls to do the painting. So yes, all that does take CPU time.
--Mike--
Ericahist | CP SearchBar v2.0.2 | Homepage | 1ClickPicGrabber New v2.0! | RightClick-Encrypt
Laugh it up, fuzzball.
|
|
|
|
|
Hi:
When I build the dll(created by others),VC says: fatal error C1189: #error : Please use the /MD switch for _AFXDLL builds,where to set this flag?
Thanks
benben
|
|
|
|
|
> Please use the /MD switch for _AFXDLL builds,where to set this flag?
In VC6 go to:
Project -> Settings (or Alt+F7) -> C/C++ Tab -> Project Options
RK
|
|
|
|
|
|
When the twisted-pair has been pulled out from a network adapter, windows 2000/xp shows the network adapter is disconnected, but how can I get this change in my application?
|
|
|
|
|
One possible solution is to access rasapi32.dll.
http://www.codeproject.com/internet/rasconnection.asp
Kuphryn
|
|
|
|
|
I wrote a program, that I installed on Win2000 in "c:\programs\myprogfolder\", logged in as administrator.
The program should create at runtime a logfile in its folder. When I run the program as normal user without admin-rights, the program can't save the logfile, cause the normal-user has no rights to this folder. Can I do something in the installation-routine, to give the program the right to save files, anyway which rights the user has, who start the prog?
Thanks for help!
Merry Christmas & Happy new Year!
Friedemann
|
|
|
|
|
Interesting.
Try setting the owner of the program to too user or to everyone.
Kuphryn
|
|
|
|
|
Hello
How can i change the fonts of Shut Down screen in windows?
"The chance of the bread falling with the buttered side down is directly proportional to the cost of the carpet." Muphy's Law
|
|
|
|
|
Hi,
Try Registry settings!
Regards,
R.Selvam
|
|
|
|
|
Hi All,
I want to add a help button to the dialog. It is a simple dialog with properties system menu and title bar set. I hope it is easy and some one of you might have done that. I tried searching on net and here and codeguru but found nothing. Please help me out.. Any help or pointers are highly appreciated..thanks a lot in advance..
regards,
Himanshu
|
|
|
|
|
|
Is it possible to call functions in a C# dll from C++ code? If so, what do I set in the build properties of the C# dll to create the .lib the C++ code needs?
|
|
|
|
|
Hi!
I created an UnManaged C++ dll in Visual7 then
added the C# assmbly with the #using Keyword.
in the UnManaged C++ dll I created some functions, which access the objects exported by the C# assembly.
the unmanaged C++ dll can be loaded by a nativ C++ Programm and access the C# Objects through the exported functions from the dll. the only bad thing is, that the C# assembly must be in the App Directory or somewhere Windows searches for a DLL.
|
|
|
|