Results 1 to 3 of 3

Thread: net send problem

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Feb 2005
    Posts
    24

    net send problem

    I made a little program that is using the net send command.I want it to display a mesage if it failed to send the message,or whatever error the dos returned.I got a tip to use a txt file (like in command.com when u write after everything >> c:\this.txt),but it doesn't work.Any ideas how can do this?
    Thanx!

  2. #2
    INXSIVE Bruce Fox's Avatar
    Join Date
    Sep 2001
    Location
    Melbourne, Australia
    Posts
    7,429

    Re: net send problem

    Here is one way.

    Note: You could remove the Else section, and place the error code after a False condition. (So you just have an If..Then)

    VB Code:
    1. Dim intFF As Integer
    2.  
    3.     'Handle sent message action
    4.     If NetMessageBufferSend(ByVal 0&, bytToName(0), ByVal 0&, bytMsg(0), UBound(bytMsg)) = 0 Then
    5.         'Message succeeded
    6.     Else
    7.         'Message failed
    8.         MsgBox Environ$("USERNAME") & ", there was an error sending your message." & vbCrLf & _
    9.         "Please try again.", vbCritical + vbOKOnly, App.Title & " - Send Error"
    10.    
    11.         intFF = FreeFile
    12.    
    13.         Open "C:\NetSend_Log.txt" For Append As #intFF
    14.             Print #intFF, Now 'Capture the date and time the failure occured
    15.         Close #intFF
    16.        
    17.     End If




    Bruce.
    Last edited by Bruce Fox; Feb 20th, 2005 at 03:53 PM.

  3. #3
    Fanatic Member x-ice's Avatar
    Join Date
    Mar 2004
    Location
    UK
    Posts
    671

    Re: net send problem

    Or if you want to use API you can look at this example, created by ME

    http://pscode.com/vb/scripts/ShowCod...51063&lngWId=1

    p.s. it has error reporting

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