Click to See Complete Forum and Search --> : Send A Window Message


eoldynski
August 21st, 2001, 03:03 PM
I am trying to send a message from a MDI child window to the main window -- How do I do that? Is there a way with out using the API?

the reason is I have several MDI-Childs that represent an instrutment on a serial buss. All instrument must communicate via the same comport to my application (of several MDI-Childs windows). But I need to synronize the data going through the serial port.
(I'm somewhat new to Vb but worked in Visual C++ for a while. and I know too do it C++ but I must use vb)

Please help!

bill brave
August 21st, 2001, 11:46 PM
In some cases, API is the best solution, why don't you use it ?.

Or you can create a public procedure in main form, so you ca call it from MDI child.

Please tell me how you do it in C++.

eoldynski
August 23rd, 2001, 03:29 PM
Thanks.. That was the sinple answer I was looking for.
I know I could use the API in basic -- But If I do that I might as well write the code in C. And I have to write this application in VB.

In C (MS Visual C++) I would define a user message, something like:
#define MSG_MY_MDI_MESSAGE WM_USER + 100

and define a function in the main window thread that is Mapped to this message.

Then send this message to the main window using the MFC call ::SendMessage

samir_chavan
October 10th, 2001, 01:20 PM
You yourself said how to do it. thenwhy don't you use SendMessage or PostMessage in VB. or you don't know how to call APIs in VB???