For all you Visual C gurus....

AznMaverick

Platinum Member
Apr 4, 2001
2,776
0
0
1) i'm looking to create a user interface which is basically a 2-d array (let's say 10x10) when a user clicks on a certain cell it will change to another color (let's say from white to black) and update an internal 2-d array (from bit 0 to bit 1).

2) I'm also looking to output data through an ethernet port, preferably ascii text would be good. Is there any easy way to do this? Is there any way that we could use the ethernet port and sort of have it acting like a serial port?

Thanks for the input guys, it is much appreciated.
 

dighn

Lifer
Aug 12, 2001
22,820
4
81
1: pretty easy to do

create a simple window and process WM_MBUTTONEUP which will give ou the coordinates which you can use to calculate the cell the point belongs to.

process WM_PAINT to draw the cells and maybe the grid if you want to.

if you want the grid to behave more like standard buttons eg you have to both click down and release the button in the same area, you can process WM_MBUTONDOWN and use SetCapture() to track the mouse even if it moves outside of the window area, and on WM_MBUTTONUP, call ReleaseCapture() and see whether the cursor is still in the same area as where the mouse button was pressed down

2: you mean you want to bypass TCP/IP and send raw ethernet frames or something? not sure how that can be done. googling yields some results about NDIS but it sounds kind of complicated...
 

AznMaverick

Platinum Member
Apr 4, 2001
2,776
0
0
Thanks for the input. I just want some way to be able to send simple streams of data over the ethernet line. I guess it could be using tcp/ip just as long as data can go from pt a (the computer) to pt b (this will be a processor with ethernet installed on it). I'm wondering if this would be easier to do on a UNIX machine, say...a mac with OSX installed. I just want something to the extent of a funciton that is like the serial read/serial write funciton. this is a simple block diagram...

________ _________
| | | |
|Computer data | processor|
| | ==> | |
---------- ethernet-------------
 

AznMaverick

Platinum Member
Apr 4, 2001
2,776
0
0
or how about packaging outgoing data using the protocol for telnet? just getting basic ascii text sent back and forth between the two lines. is that possible, (with Visual C or Visual C++)?
 

DaveSimmons

Elite Member
Aug 12, 2001
40,730
670
126
If the grid size is small / fixed you could also use a "dialog-based" MFC app in VC++ and use actual buttons (with icons or bitmaps).

VC++ "dialog-based" apps have a drag-and-drop dialog resource editor that is a little like VB, and it has a "ClassWizard" that can hook each button up to a message handler function for you.

For sending data, you can use winsock or wininet, msdn.microsoft.com, codeproject.com and google shoud all be able to find you a bunch of samples and tutorials.
 

AznMaverick

Platinum Member
Apr 4, 2001
2,776
0
0
sounds easy, but any pointers on how i would go about opening a socket and sending data?
 

AznMaverick

Platinum Member
Apr 4, 2001
2,776
0
0
Wow, it sounded easy to do (the grid) but i think i need to take classes on Visual C++. I know C pretty good, C++ not as good but i took a class, but handling objects in Visual and settup up a simple grid is more work than i thought it would be.