|
-
Mar 9th, 2003, 02:59 PM
#1
Thread Starter
New Member
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.
-
Mar 9th, 2003, 04:42 PM
#2
Fanatic Member
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.
-
Mar 9th, 2003, 05:17 PM
#3
Thread Starter
New Member
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
-
Mar 9th, 2003, 05:20 PM
#4
Fanatic Member
Do you have any objects declared? If so, try setting all objects to nothing when you exit.
VB Code:
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.
-
Mar 9th, 2003, 05:25 PM
#5
Thread Starter
New Member
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.
-
Mar 9th, 2003, 05:27 PM
#6
Fanatic Member
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.
-
Mar 9th, 2003, 05:28 PM
#7
Thread Starter
New Member
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.
-
Mar 9th, 2003, 05:31 PM
#8
Fanatic Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|