News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Project Preview - dTest

Started by dedndave, August 02, 2011, 09:09:20 PM

Previous topic - Next topic

dedndave

thanks, Yves
i use a list and function that i wrote a while back
it is similar to the FormatMessage function
http://www.masm32.com/board/index.php?topic=16460.msg137899#msg137899

i see your list has some messages that i am missing, though   :U

baltoro

I learned to program Windows (in C++) by reading these two books:   
Both are somewhat dated, but, are excellent otherwise. Feng Yuan's book, especially explains the basics of Windows graphics thoroughly. Chapter One is: Here. Both books come with a CD containing all the source code examples from the book.

Translating C++ code into assembly language is straitforward,...you just invoke Windows graphics API functions in sequence. Even a nitwit like me can do that,... :eek
As you've probably noticed,...there aren't any books about assembly language Windows graphics programming. This forum is the source for the entire world.

Baltoro

dedndave

thanks for the sources
i think we've all seen Petzold's examples at one point or another   :U

i managed to find Yuan's book in CHM form....
http://www.4shared.com/file/j6QT3Spd/FengYuan.html
i'll give it a look

for me, i don't have a real problem displaying stuff   :bg

my problem in that department is the tedious code that decides which part of the screen requires update, if any
i took some shortcuts in that regard and got decent results
for now, that's good enough
i can move on with the rest of the project and come back to that later, if desired

up to this point, i have been using it as a test-bed for learning how windows works
i have spent a lot of time "playing", really
which is, in some ways, a good way to learn

this particular version of the program was a "proof of concept" for me
i wanted to see if i could use WM_COPYDATA to talk between 2 different applications, and to see how fast it was
my code in that area is a bit rough - i kind of threw it together
but, i set up a minimal communications protocol with message/acknowledge handshaking
just to see how it would go   :P

i added a "continue" command to keep long messages from timing out
and a "flush" command for error recovery
i may add a "resend request" command to use in recovery of missed messages
at this point, i haven't missed any messages, though - lol

there is a small problem here, and that is sequencing (or synchronizing, if you prefer) messages
the method i am using now sequences messages in a half-duplex mode
(i.e. messages received in window A are handled in the same order as they were sent from window B,
messages received in window B are handled in the same order as they were sent from window A)
i haven't figured out an efficient way to sequence them full-duplex, and i am not sure i need to

baltoro

The more I read from your application, the more I understand. It's good stuff,...
Regions (MSDN refers to these as Legacy Graphics) are a pain in the ass. Just enumerating them is tedious and memory intensive. Often, they are used used to perform hit testing.
I was in the process of writing a DirectX application that edits meshes (which you use alot in 3D), and, when I got to the point where I had to implement a variable number (usually large) of regions that conform to the sides and vertices of triangles displayed on the screen, so that the user could select an element to edit with a mouse click, I just realized that it was going to be enormously time consuming (possibility of dying of old age), and, I decided to take a vacation.

When I want to communicate between two applications,...I just write a text file, and put it in an obvious place, then delete it when I'm done. It's dumb, but, it works. Of course, this is not production code, and I don't have to worry about customer support.
Baltoro

dedndave

yah
i chose to stick with mono-spaced system fonts
that really simplifies the code

my paint code does a good job of painting text only inside the update rectangle
but, i took the lazy way out when it comes to telling the OS which areas to include in that rectangle - lol
if/when i put the back buffer code in there, the current paint code should be helpful

because i used mono-space fonts, the whole thing is still pretty fast, even with my short-cuts

beyond fixing the update method and adding a back-buffer, extending font capability is an area with room for improvement - lol
i could also offer something like the console in the way of character-cell attributes
i have no intention to go beyond text with this particular application - so no "real" graphics stuff   :P

have you tried Ctrl-Wheel ?

baltoro

Quote from:  DAVEhave you tried Ctrl-Wheel ?
Ah, yes, your zooming code. Seems I vaguely remember a thread on that subject. And, no, I've never used it, sorry.
I'd probably do it in some more cumbersome way,...
My current crackpot theory is that competent programmers are just making reality TOO EASY for consumers,...and this is a major reason we have so many obese people in America,...(I tried to convince EDGAR of this,...and, now, he thinks ALL Americans are whackos,...)
Baltoro

dedndave

i was lazy, again, when it came to handling the mouse wheel - lol
i calculate the movement......
..... and use PostMessage to make it scroll   :lol

simplified the code, and it seems to work fine