|
Are you 100% your sorting algorithm is the problem? Try commenting out the call to sort and see if that speeds up your program. sorting 16 elements shouldn't take any time at all.
|
|
|
|
|
You should do a couple of things.
1. Post some code so people can comment intelligently on what you are doing.
2. Put your array into a binary tree or sorted list, so that it remains sorted at all times.
3. If there are 'many' for loops, you're probably using bubble sort - if you use an STL container it is trivial to use a more efficient sort, not that this should matter for 16 elements ( although you don't say what they are. If they are large items and you sort by making deep copies, this could be the problem )
4. The most likely problem could well be your drawing code, but I cannot comment if I have not seen it.
Christian
#include "std_disclaimer.h"
People who love sausage and respect the law should never watch either one being made.
The things that come to those who wait are usually the things left by those who got there first.
|
|
|
|
|
If i comment out the following codes, my display is much faster:
//Check Alpha Line first
for (int i=0; i
|
|
|
|
|
Hi,
I use CreateFile for use the Comport and LPT.
With Comport : I would like to know how data is in the InputBuffer ?
With LPTport : I would like to use Strobe, Init, Status, ...
and How can I do for read and write a data in PCICard ?
How can I do it ?
Best regards
youssef
|
|
|
|
|
Hi,
I use CreateFile for use the Comport and LPT.
With Comport : I would like to know how data is in the InputBuffer ?
With LPTport : I would like to use Strobe, Init, Status, ...
and How can I do for read and write a data in PCICard ?
How can I do it ?
Best regards
youssef
|
|
|
|
|
can somebody please help?!! what am i doing wrong here:
CDialog m_wndSlider;
m_wndSlider.Create(IDD_SLIDER_DLG,this);
m_wndSlider.ShowWindow(SW_SHOW);
the dialog wont display! (i am using cdialog instead of my CDialog derived class to eliminate these errors. ID_SLIDER_DLG is an empty dialog...
thanks
|
|
|
|
|
You are destroying the CDialog object.
Since it's a modeless dialog, the MFC object should survive enough to show up. Either make it global or member of a class (maybe CWinApp?).
Cheers,
Paolo.
|
|
|
|
|
Hello,
We have an ActiveX control (T3Result.ocx) and we recently created a separate project dll (T3Resultfrares.dll) containing the French versions of our resource strings. However, everytime we build the ActiveX control, we get this message:
Warning: cannot find "T3Resultfrares.dep"
What is a .dep file? Can I re-create it to get rid of this warning? If not, can I do something to stop the message?
Thanks in Advance!
Derek
|
|
|
|
|
Hello,
We have an ActiveX control (T3Result.ocx) and we recently created a separate project dll (T3Resultfrares.dll) containing the French versions of our resource strings. However, everytime we build the ActiveX control, we get this message:
Warning: cannot find "T3Resultfrares.dep"
What is a .dep file? Can I re-create it to get rid of this warning? If not, can I do something to stop the message?
Thanks in Advance!
Derek
|
|
|
|
|
Hi ,
I need to bitblt some polygon - not rectangle
( i have it as CRgn ).
Probably there's somewhere modified BitBlt function that looks similar to that
[ccode]
BOOL BitBltRegion(
CDC* pDestDC,
int ptVertex[0].x ,
int ptVertex[0].y ,
CDC* pSrcDC,
CRgn reg,
DWORD dwRop );
[/ccode]
or somebody can give me a hint to write it myself
I'd very happy to know , or probably there's
another way ( masks ? )
Thank You
in advance
|
|
|
|
|
I think what you might want to do is create a polygonal region equivalent to the polygon you want to blit, then select that region as the clipping region of your destination device context.
If you blit the rectangle containing the polygon at the right coordinates after this clip region is set, it should to the trick. See CDC::SelectClipRgn.
|
|
|
|
|
Thank You , Tim , works great !
Just not to forget restore original clipping region after that ..
|
|
|
|
|
By the way , does it mean that if I want to work with DCs like with
layers , when u don't see some parts of picture under
topmost layer ( DC ) , u should do the same - use SelectClipRgn ?
|
|
|
|
|
Hmmm... don't know if I'd go that far - if you have a background DC that holds the entire screen, I'd just draw it on to that and blit a rectangle of whatever has changed to the screen DC.
If you have layers, maybe I'd still combine them in the background before blitting.
I posted a new article here that plays with this kind of stuff, but I'm not a games programmer so mine isn't going to be the best advice - I'm just trying to explore the mechanics at this stage.
|
|
|
|
|
I have an MFC CSocket application in Win 95. During runtime when I send data through the socket an ASSERT fails in the file sockcore.cpp at line 755, which reads:
ASSERT(m_hSocket == INVALID_SOCKET || CAsyncSocket::FromHandle(m_hSocket) != NULL);
When I ignore the error my data arrives just fine at the other end of the connection. Where does this error come from and how do I suppress it?
Thank you
LP
LP
|
|
|
|
|
Hi folx!
Does anybody know a way to adjust the line length in the debugging output window of vc6?
thnx a lot.
(Best Regards,)
Patrick Hoffmann
-------------------------------------------------------------------------------
Technical and Operations Manager, System Analyst, Software Architect
PGP: http://www.novacom.net/pgp/PatrickHoffmann.asc
-------------------------------------------------------------------------------
veturo, der kostenlose NOVACOM Routenplaner für Europa... http://www.veturo.de
--------------------------------------------+-----------------------------
|
|
|
|
|
Hi all,
I have question about data types ...
I want to know, does UINT variable is equal with long variable ? I mean is size ?
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
|
|
A UINT is absolutely not the same as a long. They're the same size, 4 bytes, but UINT is unsigned, whereas long is signed.
Also, the sizes may change in future versions of the compiler.
--Mike--
http://home.inreach.com/mdunn/
Sometimes, arming yourself with a big pointy stake just won't do you any good.
|
|
|
|
|
His question was whether or not they (a UINT and a long) were the same size.
Yes, they are the same size (in our 32-bit world of VC6).
They were not the same size as a long in 16-bit, but who does 16-bit any more?
|
|
|
|
|
UINT is defined as unsigned int. The int type is different on different machine types. On Windows 32 bit it is 32 bits wide. long is well defined as a 32-Bit signed value on all machines. So int is not long! and UINT equals a unsigned long on a 32-Bit architecture. So on such a machine long equals UINT in that way, that both uses 32 bit (4 bytes). But long uses the highest bit for the +/- sign instead of UINT that has no sign.
(Best Regards,)
Patrick Hoffmann
-------------------------------------------------------------------------------
Technical and Operations Manager, System Analyst, Software Architect
PGP: http://www.novacom.net/pgp/PatrickHoffmann.asc
-------------------------------------------------------------------------------
veturo, der kostenlose NOVACOM Routenplaner für Europa... http://www.veturo.de
--------------------------------------------------------------------------
|
|
|
|
|
Thanks for your reply ...
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
Hi,
I like to know how can I use the function:
OpenDocumentFile(FileName) in my CView class.
I have a bunch of files, and I like to use this function to open the files.
and each file has to be in a new document.
Thanks
Ehsan Behboudi
|
|
|
|
|
You can use AfxGetApp()->OpenDocumentFile( "filename.ext" );
-Ben
---------
On the topic of code with no error handling -- It's not poor coding, it's "optimistic"
|
|
|
|