Results 1 to 25 of 25

Thread: Delegates *Given Up*

Threaded View

  1. #1

    Thread Starter
    Frenzied Member <ABX's Avatar
    Join Date
    Jul 2002
    Location
    Canada eh...
    Posts
    1,622

    Delegates *Given Up*

    I have Two classes that I am porting from C#, SocketClient and SocketServer both Delegate Declarations are the same

    VB Code:
    1. 'Delegate Declarations
    2.  
    3. Public Delegate Sub MESSAGE_HANDLER(ByRef pSocket As SocketClient)
    4.  
    5.         Public Delegate Sub CLOSE_HANDLER(ByRef pSocket As SocketClient)
    6.  
    7.         Public Delegate Sub ERROR_HANDLER(ByRef pSocket As SocketClient, ByRef pException As Exception)
    8.  
    9.         Private GetMessageHandler As MESSAGE_HANDLER
    10.  
    11.         Private GetCloseHandler As CLOSE_HANDLER
    12.  
    13.         Private GetErrorHandler As ERROR_HANDLER

    This is how its done in C#
    Code:
    'here is where i run into problems
    
                  pClientSocket = AddSocket(
    				new SocketClient(this, 
                    pSocket,
                    pSocket.RemoteEndPoint.ToString().Substring(0,15), 
                    GetPort,
                    GetSizeOfRawBuffer, 
                    GetUserArg,
                    new SocketClient.MESSAGE_HANDLER(GetMessageHandler), 
                    new SocketClient.CLOSE_HANDLER(GetCloseHandler), 
                    new SocketClient.ERROR_HANDLER(GetErrorHandler)));
    I cant figure out how do to this in vb.net

    any ideas?
    Last edited by <ABX; Mar 11th, 2004 at 09:51 PM.
    Tips:
    • Google is your friend! Search before posting!
    • Name your thread appropriately... "I Need Help" doesn't cut it!
    • Always post your code!!!! We can't read your mind!!! (well, at least most of us!)
    • Allways Include the Name and Line of the Exception (if one is occuring!)
    • If it is relevant state the version of Visual Studio/.Net Framwork you are using (2002/2003/2005)


    If you think I was helpful, rate my post
    IRC Contact: Rizon/xous ChakraNET/xous Freenode/xous

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