Valhalla Legends Forums Archive | Visual Basic Programming | IRC Client help

AuthorMessageTime
Severance
Well, ive decided that I would like to have visual basic as a language that I could fairly understand. So ive decided to try to program my own IRC client to get the hang of using the winsock control. So far, I have got the program able to connect to a given server on a given port with a given nickname, and it is able to join channels and send messages throughout the channel. The only thing that I cant figure out how to do now is tell the textbox to display incomming chat messages,  and display the userlist in another text box. I have come up with the code :
winsock.SendData "PRIVMSG" & " " & txtChannel & vbCrLf for the sending of the messages. But would receiving the messages use the same PRIVMSG command, only using GetData instead of SendData work? I hope I worded this right, but any help would be appreciated a lot.
August 16, 2007, 12:49 AM
l2k-Shadow

[code]
Private Sub Winsock_DataArrival(ByVal bytesTotal as Long)
Dim Data As String
Winsock.GetData Data, vbString, bytesTotal
' Data should hold your incoming message.
End Sub
[/code]
August 16, 2007, 12:52 AM
Severance
Wow, didnt realize that would display messages too, thanks. But I have one more problem. I want to have two forms for this client. The first form is where the winsock is, and it has all the connection info and stuff. The seccond form is where the chatting goes down, with the userlist and such. My problem is, I do not know how to just display incomming messages in the seccond form. One again I would appreciate if anybody could assist me in this matter, thanks.
August 16, 2007, 1:24 AM
l2k-Shadow
[code]
FormName.Text1.Text = "Hello"
[/code]

lol
August 16, 2007, 1:31 AM
Severance
Lol, I know that, but do you know how to put incomming chat messages into the text box?
August 16, 2007, 1:52 AM
Severance
Oh nvm, misunderstood for a sec. I got it now though. Thanks for the help.
August 16, 2007, 2:00 AM
rabbit
http://www.irchelp.org/irchelp/rfc/rfc.html helps
August 16, 2007, 3:04 AM
Severance
Thanks, I was looking for something like that.
August 16, 2007, 3:26 AM
BreW
For the output, that simple one-liner isn't going to be enough. I recommend you create a sort of an "AppendText" subroutine which does exactly that, appends the text you want to a multilined textbox. This can easily be done with the .SelStart, .SelText, and .SelLength properties. If you really have trouble with that, too, you should just use debug.print for now, or debug.append. Either works great. It seems that if you are having this much trouble with outputting data, you should work on this before creating a winsock application. Although it does kind of seem as if VB6 isn't your first programming language you've learned.... is this true?
August 16, 2007, 3:41 PM
Severance
Well actually Im new to programming in general. I usually work with web design and fairly understand the language of php. But people have told me that you should start with VB if you want to learn application programming.
August 16, 2007, 4:09 PM
rabbit
No.  Wrong.  Fail.  Start with C.
August 16, 2007, 4:17 PM
Severance
Is that an easier language?
August 16, 2007, 4:25 PM
rabbit
It's better.
August 16, 2007, 5:22 PM
Barabajagal
No, VB is probably the easiest language to learn in existence, as well as the most common. The BASIC series was designed as an educational, or introductory language. However, most programmers never move beyond it now because all the other languages are 'too hard', and in reality, VB can do pretty much whatever most programmers want (although not in the most efficient or best ways). C is a more powerful, faster, and universal language. If you have enough willpower, take a VB class and learn VB... use it for 2 years or so, and when you've mastered the basics of application programming, learn another language such as PowerBASIC, C, C++, Java (if you want easy multi-os applications/web applets), etc...
August 16, 2007, 5:30 PM
Severance
Sounds good, Ill try to keep all that in mind. Thanks.
August 16, 2007, 6:06 PM
rabbit
Ignore Andy.  If you know PHP well enough, C will be easy.
August 16, 2007, 7:23 PM
Severance
lol okay.
August 16, 2007, 10:23 PM
FrOzeN
I completely agree with rabbit. Learn C first up, especially if you have some understanding of php. VB6 is easier to learn, but is completely impractical for anything more than hobby language. Also, if you were to learn VB6 first, you'll find that when you do want to move onto languages like C, that'll it'll be harder to pick them up because of bad programming skills VB6 teaches you.
August 17, 2007, 4:51 AM
Hell-Lord
VB6 still has quite a big base in the programming world. Majority of it are programmers who refuse to change but a lot of businesses still use it. Obviously if you are fluent in a language like C then you are set for programming in almost every language.
August 17, 2007, 6:35 AM
BreW
[quote author=FrOzeN link=topic=16950.msg171655#msg171655 date=1187326261]
Also, if you were to learn VB6 first, you'll find that when you do want to move onto languages like C, that'll it'll be harder to pick them up because of bad programming skills VB6 teaches you.
[/quote]
Vouch
August 17, 2007, 11:55 AM

Search