473,386 Members | 1,830 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Using VB6 Winsock in VB.net

Since there is no Winsock for VB.net, I am trying to use the Winsock control
from VB 6 in my VB.net program. I have "imported" the control to the VB.net
toolbox and am able to connect to a remote server and send data. My problem
is in receiving the return message.

In my VB6 program I have the following and it works....

Private Sub tcpData_DataArrival(ByVal bytesTotal As Long)
Dim strData As String
tcpData.GetData strData
tbRecData.Text = strData
End Sub

When data arrives, the event fires and tcp.GetData puts the data into the
string strData..

My VB.net code is.....

Private Sub AntData_DataArrival(ByVal bytesTotal As Long)
Dim strData As String
AntData.GetData(strData)
TextBox1.text = strData
End Sub

This doesn't fire for some reason, any help here????? also.....

There is another code snippit....

If AntData.BytesReceived <> 0 Then
AntData.GetData(b) 'b is a string

I have this in a loop, and AntData.BytesReceived does count the bytes but
when I try to get them into a string b, the AntData.GetData(b) fails with an
errror that I cannot put a string where a byte variable is expected.

Any help here??????

Any other suggestions would be appreciated.

Thanks
Hamil.

Nov 21 '05 #1
0 1073

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Dan | last post by:
I'm writing a simplistic telnet client in VB6 and I've run into a small snag. The program has a textbox to write in the string to be sent using ..SendData and has another textbox that displays...
4
by: Ophir | last post by:
Hello all ! I wrote a simple ActiveX DLL to wrap winsock functionality so I can use it in an ASP page. I call it MyWinSock In the Class module I use this declaration: Dim ctlSocket as...
1
by: Chris Thompson | last post by:
I'm trying to mess around with creating a multi-user server but I'm really clueless as to how to start. I don't know what I'd need to do, and more than likely it's over my head, but I'd still like...
10
by: feel52 | last post by:
Below you'll find the code i'm working on. It's in a button click routine and hangs after 3 or 4 sometimes 5 loops done, probably in sock.receive(....). Some code was found here( on google i mean)...
2
by: Nadav | last post by:
Hi, I am about to write a performance critical application and I wonder what is the best way to implement it... Should I use the standart Win32 winsock DLL or should I rather use the new managed...
1
by: Minti | last post by:
Hi there all, I am using some example code about using winsock. Private Sub Form_Load() ' The control's name is udpPeerA With udpPeerA ' IMPORTANT: be sure to change the RemoteHost ' value to...
5
by: kc | last post by:
Hi Just upgrading a app from VB6 to VB.Net. All is going well apart from the Winsock control. The first thing we notice is that there does not appear to be a .Net version (please correct me if...
2
by: Dudule | last post by:
Hello, No answer from "comp.lang.basic.visual.misc", so i try to post here...: Using WINSOCK to acces the Web, in Visual basic 6 application, most of the time it is working fine, but with some...
1
by: Nicolas Ghesquiere | last post by:
Hello I have a problem with my current program. The meaning of the program is to allow users to login to a server to allow them to access the internet. My program communicates with a MS isa...
1
by: kpaxoid | last post by:
An odd problem. Application runs fine in the VB6 IDE, but when compiled, as soon as the application attempts to execute Winsock.Listen 'Winsock is created by Winsock = New Winsock the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.