|
I read the pattern. Basically, it seems to resolve into these major issues:
1. Don't redraw objects in your list unless a new or relocated object uncovered it.
2. Don't draw objects in your list that are completely obscured by another object.
3. While dragging an object, don't redraw all objects on screen, only those that were uncovered - OR - wait until there is some other event, like mouse up, and then redraw objects that were uncovered along the way.
If you keep adding to the invalidation rectangle as an object is moving, and then invalidate that rectoangle after the object stops moving, when your window paint message comes along, the paint rectangle will match your invalidated rectangle. Go through your list and only draw objects that are partially or entirely within that rectangle, and skip all the others. Not 100% efficient, but it will get you going and be better than redrawing EVERYTHING each time you get a paint message.
|
|
|
|
|
First of all, you really want to make sure that you have a performance problem. Start with double-buffering the output and killing WM_ERASEBKGND.
|
|
|
|
|
Hello guys,
I have to build a neural network for my project and I have to code for it in VC++, but I am not able to find any staright tutorilas which will discuss about the implementation or the way in which we have to proceed to build aneural network in VC++. Can anyone help me out by advising or giving me code for building a simple neural network. Please help me out as early as possible.
Pavan Kumar N Tiruveedhula
2382 Duncan Dr #4
Fairborn, Ohio-45324
1 (978) 473-1244
|
|
|
|
|
Is there a message or function for a CWnd that is after the CWnd has been created but before it is displayed, something similiar to the OnInitDialog for a CDialog object.
Thanks
|
|
|
|
|
|
In that case is there a message before the window is displayed but after CView and CDocument have become active, so that I can use CFrameWnd::GetActiveDocument() from MainFrame?
Thanks
|
|
|
|
|
I am wondering if anyone has any other ways of tallying up the filesize of all files in a folder than the following:
Using CFileFind recursively to get a list of all files in the specified folder and its subfolders, and calling CFile::GetStatus() on each file found to tally the total filesize.<br />
I've discovered that this is quite quick to do for folders with thousands of files if it is on a local HD, but if it's across the LAN on a seperate box it is rather slow to do this.
I need a different way of doing this that will be much quicker: I have a set of many folders to check filesizes on, and if just one folder is taking 20 seconds, it's killer to wait for a set of 50 folders, heheheh.
If anyone has a better way, let me know!
: Dean 'Karnatos' Michaud
|
|
|
|
|
Doing the same thing across the network is going to be slower than doing it on the local machine, you can't stop that.
You might make it marginally faster by having a service on the remote machine do all the disk\file work for you and return just the folder totals. There will still be overhead of network communications but the service will be accessing the disk locally and so might be somewhat faster depending on the layout of the files and folders on the disk.
A further step would be to have the service monitor the folders and keep an semi-real-time total of the folders which it could return without scanning the disk at request time.
"No matter where you go, there your are." - Buckaroo Banzai
-pete
|
|
|
|
|
This http://support.microsoft.com/?id=835601[^] talks of a similar problem?
Why not make a socket-based app at the other end of the connection, and make that app do the CFileFind thing on the remote comupter. This would take some effort no doubt, but I suppose it should be faster than using CFileFind on a local pc with a remote directory...
Bikram Singh
|
|
|
|
|
Yeap - I've thought about having a service on the other end that keeps a tally in real-time and have my app just ask it for the folder sizes. If I have to I'll take that approach.
I'm just wondering if there is any other way that might even be marginally faster than what I am doing. I was wondering if there's a way to query a folder's size rather than querying each and every file as I am doing.
I'll have a look at that MS article now... perhaps it might shed some light on things for me. Thanks to both you and palbano for quick replies. If anyone thinks of something else I'm all ears
|
|
|
|
|
>> If anyone thinks of something else I'm all ears
Well you might also take a look at using FTP. At least that way you don't have to build your own service just the client to communicate with FTP. FTP without getting into file transfers is fairly simple.
"No matter where you go, there your are." - Buckaroo Banzai
-pete
|
|
|
|
|
I managed to cut the time it takes down by half.
I was being dense, I did not realise that CFileFind can return the filesize without having to call CFile::GetStatus().
It's still slow, so if anyone else knows of a quicker way, other than using a service on the networked PC, feel free to let me know!
: Dean 'Karnatos' Michaud
|
|
|
|
|
No, but if you DO end up writing a service, then you can also use the file change notifications, if you are only wathcing a few directories, and the OS will let you know if anything has changed in the folder, so you won't even really need to periodically scan the folder, you will be told when something is different about it!
We ran into this same network issue, and went the 'remote app' route.
|
|
|
|
|
CFileFind might be converting the date and times to c style dates and times. In your case, I doubt it matters much, but I have seen applications where the conversions where taking up over 20% of the process time. You might try using the WIN32 functions directly.
Tim Smith
I'm going to patent thought. I have yet to see any prior art.
|
|
|
|
|
How to complile WMI andf ADSI with studio version 6 ?
Including ADSI .h files
I have errors of "not dofined classes",
same abour sample from this site.
When I install Platform SDK 2001 (for time of studio),
error changes to RPC files .h can not right compile.
How to resolve it?
Install new Platform SDK 2004 ?
(All works fine in 7.1 studio, but buyer wants 6.0 version).
thanks
|
|
|
|
|
Hi all
I had trouble with registration my own ActiveX component in Win98.
I make one in VC.7 and compiled under Win2000 ,and when i
register one under Win2000 all fine.But when i register same component under Win98 regsvr32 rise error: "0x0000045a"
Registration routine filed .I explore this scomponent's dll by depends.exe and all depended file presented on the target(Win98) platform.
P.s. component use multi byte character set
Any idea???
Thank.
|
|
|
|
|
This problem happens probably because the Win98 don't have native support to Unicode.
Check if your machine Win98 have Uicowslib.dll installed. If not, Install support for Unicode for Win98, and then, try to register your component.
Also, you can static link your dll with Uicowslib.lib.
Enjoy it
Rodrigo Pinho Pereira de souza
|
|
|
|
|
http://msdn.microsoft.com/msdnmag/issues/01/10/MSLU/default.aspx
Enjoy it
Rodrigo Pinho Pereira de Souza
|
|
|
|
|
|
could some give me a sample program to write a DDE server program for Excel that updates the sheet every 1 minute.
|
|
|
|
|
repost...
TOXCCT >>> GEII power
|
|
|
|
|
Need help with using VC++6 .dll and .lib with VC.NET.
I add the .dll and .lib to the Linker option and #include a .h file that has the function definitions.
Seems that the functions in the .dll and .lib are found by the compiler and linker but VC.NET does not like something about the way they are formatted???
Is there something new in VC.NET that I'm missing? These .dll and .lib files work perfect in VC++6.
Thanks.
|
|
|
|
|
For compile error that you will face in VC7,
VC7 has a updated version of STL and stronger type checking. Do expect some compile errors like type checking error, STL related errors and etc. But it should be obvious and easy to fix.
For linker error that you will face,
As you know that VC 7 uses upgraded version of STL and other CRT. Do expect some function conflicts or incompatible problem during linkage stage. Theoritically, a updated STL should work with lower version but not in this case. Other than this problem, you will face another error like fatal error LNK1235: corrupt or invalid COFF symbol table. Linker error that relate to COFF. COFF symbol table is not generated in earlier version of Visual C++ compiler as the /clr switch is not exist at that time.
The quick fix for this is to recompile your VC6 lib to reproduce a newer one with VC.NET. Other than that, what I think of is not to use the lib in VC.NET.
Sonork 100.41263:Anthony_Yio
|
|
|
|
|
Using visual studio c++ 6.0 , when building exe but have some compilation error the link hangup and I need to Kill the compailer using task manager.
need some help on this.
Geffen
|
|
|
|
|
which service pack do you have ?
C makes it easy to shoot yourself in the foot; C++ makes it harder, but when you do, it blows away your whole leg
|
|
|
|