|
-
Feb 7th, 2003, 02:46 PM
#1
Thread Starter
Hyperactive Member
C# to VB>NET
I am in the process of translating a C# Class into a VB.NET class. My problem is, I have one line that I cannot decipher. This line is:
VB Code:
networkStream.BeginRead(bytes,1,1,new AsyncCallback( TcpDataRecieve ), myPOP);
TcpDataRecieve is declared as:
VB Code:
Public Sub TcpDataRecieve(ByVal ar As IAsyncResult)
Can anybody help me decipher this line? It is the only one I cannot decipher
-
Feb 7th, 2003, 03:21 PM
#2
yay gay
if i am not in mistake it should be exactly the same ..just remove the ; in the end..
\m/  \m/
-
Feb 7th, 2003, 04:35 PM
#3
Thread Starter
Hyperactive Member
When I do that I get:
ASyncCallBack is a delegate type. Delegate construction permits only a singly AddressOf expression as an argument list. Often an AddressOf expression can be used instead.
-
Feb 7th, 2003, 04:37 PM
#4
yay gay
ah now i see: try this:
VB Code:
networkStream.BeginRead(bytes,1,1,addressof AsyncCallback( TcpDataRecieve ), myPOP);
hope it works
\m/  \m/
-
Feb 7th, 2003, 05:16 PM
#5
Thread Starter
Hyperactive Member
Now I get:
ASyncCallBack is a type and cannot be used as an expression.
And:
Argument not specified for parameter 'ar' of 'Public Sub TcpDataRecieve(ar as System.IASyncResult)
If you know of a Pop3 server class that works, let me know. It would save me a lot of time and trouble
-
Feb 7th, 2003, 09:28 PM
#6
Frenzied Member
This is what it should be.
VB Code:
networkStream.BeginRead(bytes,1,1, AsyncCallback(addressof TcpDataRecieve ), myPOP)
Here is an excellent article on Delegates
http://msdn.microsoft.com/library/de...egates/TOC.ASP
Dont gain the world and lose your soul
-
Feb 8th, 2003, 10:41 AM
#7
yay gay
i never got to understand very good delegates in vb.net :\
\m/  \m/
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
|