CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Oct 2000
    Posts
    10

    Send A Window Message

    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!




  2. #2
    Join Date
    Apr 2001
    Posts
    44

    Re: Send A Window Message

    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++.




  3. #3
    Join Date
    Oct 2000
    Posts
    10

    Re: Send A Window Message

    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


  4. #4
    Join Date
    Jun 2001
    Posts
    14

    Re: Send A Window Message

    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???


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured