"Joseph M. Newcomer" <newcomer@flounder.com> wrote in
See below...
On Wed, 24 Mar 2010 15:39:26 -0500, "Peter Olcott"
<NoSpam@OCR4Screen.com> wrote:
"Hector Santos" <sant9442@nospam.gmail.com> wrote in
message
news:ufF$nt3yKHA.928@TK2MSFTNGP05.phx.gbl...
Peter Olcott wrote:
"Joseph M. Newcomer" <newcomer@flounder.com> wrote in
message
news:ndgkq5lbilsibpqql11bi0d0tp6b6psl6q@4ax.com...
If you want text on a dialog box, place a static
control
there and use SetWindowText to
tell it what to display.
I don't think that will work because I need to specify
every detail of the text, its font, foreground color,
et
cetera. In any case this is all moot now anyway. I am
simply bitblt-ing my memory bitmap to the window.
Developing the style of writing directly to a dialog
box
surface will eventually uncover a
large set of problems, none of which you want to deal
with.
joe
This is only for internal testing purposes.
Then even more the reason to just use the IDE and
controls
as to not waste time learning something you will never
use
anyway - like Intel Chip Caches. :)
--
HLS
Here is an interesting note that I don't understand. A
slight revision (to make it a little less CPU intensive,
thus more memory intensive) only actually achieves 21 MB
per
second of the 12 GB / second maximum RAM speed. (RAM
speed
reported by MemTest86).
const uint32 size = 100000000;
std::vector<uint32> Data;
uint32 Max = 0x3fffffff;
void Process() {
clock_t finish;
clock_t start = clock();
double duration;
uint32 num;
for (uint32 N = 0; N < Max; N++)
num = Data[num];
finish = clock();
duration = (double)(finish - start) / CLOCKS_PER_SEC;
printf("%4.2f Seconds\n", duration);
}
Another thing that I don't understand is that it crashes
when
num = Data[num];
is replaced by
num = Data[N];
****
Another meaningless use of the word "crash". I have no
idea what it does. Does it
generate an access fault? Or a bounds check? Duh. This
is another "gee, my program
doesn't work, what did I do wrong?" question. Of course,
a reasonable bug report would
say "I got an access fault in the above code when the
value N is <value told here>" and
you would also have said how big Data is (how many
elements in it?).. Otherwise, the bug
report is flummery, and cannot be diagnosed. Unless I run
it and obtain the information
that should have been in the bug report. Only amateurs
fail to give relevant information
when an error occurs.
I note that the std::Vector Data is not actually set to
any value. There is no setsize()
call done to create any objects in the vector, nor any
push_back calls. So it is empty.
Furthermore, the integer num is not initialized, so has an
undefined value (most likely
0xcccccccc if you are running in debug mode). As
written, the code should not work at
all
I am curious why QueryProformanceCounter was not used, but
the low-resolution and largely
unreliable clock() function (resolution: 15ms) is used.
joe
****
Joseph M. Newcomer [MVP]
email: newcomer@flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm