This is pretty much how I would do it, except I wouldn't worry too much about the number
If you start it with AfxBeginThread, as I pointed out, you do not need the thread ID for
anything, because you will use CWinThread::PostThreadMessage and therefore there's nothing
you need to do special to get it.
It is your responsibility to identify the information you need. In my example, I
PostMessage a length and pointer, but you could create a little object on the heap that
had the length, pointer, and any information you need to identify the source of the data.
There's nothing that limits what you transmit to the receiving thread.
That's right. If you want anything else, you have to provide it.
Or you can do
CMyStuff * d = new CMyStull(length, data, port_number);
The point is, YOU get to define what is in that message! If all you need is a length and
pointer, you can use WPARAM and LPARAM; if you need more, you put more into what you pass
to the thread, and it is entirely your decision as to what you put there.
Joseph M. Newcomer [MVP]
MVP Tips: http://www.yqcomputer.com/