CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Jun 1999
    Posts
    2

    Pumping Messages

    OK, Here's a question...

    I am a VC++ developer, and I am writing a VB client for one of my C++ servers. I want to know how to make a VB app that is a Sub Main() based project, pump messages or run.
    If you load a form, VB will run the UI until a user presses a button to cause an exit. I have no main form and haven't figured out how to make the Sub Main() stay alive until the server sends a exit message.
    Yes this is a little unusual, but quite needed for what I am doing. How about it?


  2. #2
    Guest

    Re: Pumping Messages

    Wouldn't this work? I don't know the Get Message API's but since your a C++ programmer you probably know them


    Sub Main()
    Dim bExit as Boolean
    Do
    ' Poll for the message here
    ' I'm not sure if you want forms to load but,

    ' If the message wants a new form to load then:
    ' Load form1
    ' Form1.Show
    ' End If

    ' If the Message wants the app to quit then
    ' bExit = true
    ' End If

    DoEvents ' Allow other windows apps to operate
    Loop Until bExit = true
    End Sub





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