Results 1 to 8 of 8

Thread: RE: VB Non-active window error

  1. #1

    Thread Starter
    New Member
    Join Date
    Nov 2002
    Posts
    8

    RE: VB Non-active window error

    Ok recently I applied a few If statements to a chat program i've made, and now it logs in fine, but i cant send messages or use any menu commands, some menu's work fine but others dont, now I found a way to fix it, by making a MsgBox appear under the new If statement i added, then when i click ok and it logs in, its fixed and everything works, but without it nothing really does, and it seems i need to clicka window that uses the chat window as its parent, any idea's on how i can fix this so i dont need that msgbox?

    thanks.
    The Itch :]

  2. #2
    Fanatic Member hothead's Avatar
    Join Date
    Mar 2002
    Location
    Missouri
    Posts
    692
    Typically, a chat program will transmit packets to a server, and the server listens on a specific port for these packets. You can define a sort of "homemade protocol." To write this in code would require a great deal of explanation, so here are the main things that need to be done in a professionally-done chat application in plain English. (There are ways to do it without the use of packets, but using packets saves a great deal of time.)


    1. Define different packets the server should handle

    2. Associate a packet with an action.

    3. When a given action is encountered, send the packet
    associated with that action.

    4. Have your server listen on a given port when the server's main form loads.

    5. Use the Winsock_DataArrival event handler to handle the incoming packets, and display them in the room's textbox.

    6. Send incoming packets to the client so the everyone can see what everyone else is saying.


    There are sample chat applications here that might give you an idea of how a chat program actually works. These examples have helped me a great deal in getting a feel of how an actual chat program works. Some use packets, some don't.

  3. #3

    Thread Starter
    New Member
    Join Date
    Nov 2002
    Posts
    8
    Nope i already built the Chat server, i just added a a few auth changes to filter out general IRC clients, and it screwed up from there, it seems the client just holds all the data it means to send in but when i close the chat window, it sends all the data it held in really fast, and sometimes it sends the data is just doesn't process the data when its recieved...odd enough
    The Itch :]

  4. #4
    Fanatic Member hothead's Avatar
    Join Date
    Mar 2002
    Location
    Missouri
    Posts
    692
    Do you have any objects declared? If so, try setting all objects to nothing when you exit.

    VB Code:
    1. Set <nameofobject> = Nothing

    Just a guess, it sounds logical based upon the description of your problem. I don't know much about IRC, so I wouldn't know of anywhere else to look.

  5. #5

    Thread Starter
    New Member
    Join Date
    Nov 2002
    Posts
    8
    Noo it isn't a IRC server, its my own protocol.
    im going to redo the auth system and hopefully it will still work with the desired effects, but sometimes when i restarted the server the client wouldn't work right, anyway, thanks for your help.
    The Itch :]

  6. #6
    Fanatic Member hothead's Avatar
    Join Date
    Mar 2002
    Location
    Missouri
    Posts
    692
    That's normal. Just disconnect from the server, and then reconnect, see if that helps. You might also want to send some kind of notification that the server has disconnected, so all clients know you have disconnected, and won't think something's wrong.

  7. #7

    Thread Starter
    New Member
    Join Date
    Nov 2002
    Posts
    8
    Nope, its a error i've gotten before, i have a window that uses the chat window as its parent pop up and make me click ok, then it will work perfectly fine....something to do with active window parameters, but I really dont know.
    The Itch :]

  8. #8
    Fanatic Member hothead's Avatar
    Join Date
    Mar 2002
    Location
    Missouri
    Posts
    692
    Well, you might want to check out some of the examples on the site I posted, maybe you'll get lucky and find something that fixes your problem.

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