Jump to content

retry and retry - I don�t understanding...


Recommended Posts

http://www.ostrosoft.com/oswinsck.asp

Installation

Posted Image

for use with Visual Basic 6 (any edition):

1. download http://www.ostrosoft.com/download/oswinsck.zip

2. from downloaded file unzip OSWINSCK.dll to Windows System directory

3. run "regsvr32 OSWINSCK.dll" from command-line

file.vbs - is ok

Total = 0
sBuffer = ""
bClose = True

Set oWinsock = CreateObject("OSWINSCK.Winsock")
owinsock.Protocol = 0
WScript.ConnectObject oWinsock, "oWinsock_"
oWinsock.Connect "129.6.15.28", 13

Sub oWinsock_OnClose()
 WScript.Echo sBuffer & "Total:" & Total
 oWinsock.CloseWinsock
 bClose = False
 Set oWinsock = Nothing
End Sub

Sub oWinsock_OnDataArrival(bytestotal)
 sBuffer = sBuffer & oWinsock.GetDataBuffer
        Total = Total + bytestotal
End Sub

While bClose
 WScript.Sleep 1
WEnd

file.au3 - not work! :):(:D what is wrong?

$sbuffer = ''
$total = ''
$bclose = False
$owinsock = ObjCreate("OSWINSCK.Winsock")
$owinsock.Protocol = 0
ObjEvent($owinsock, "oWinsock_")
$owinsock.Connect("129.6.15.29", 13)
;
While Not $bclose
   Sleep(1)
WEnd
;
Func oWinsock_OnClose()
   $owinsock.CloseWinsock()
   MsgBox(0, "BytesReceived:" & $owinsock.BytesReceived, 'StringLen($sbuffer) = ' & _
         StringLen($sbuffer) & @CRLF & '$total = ' & $total)
   $bclose = True
   $owinsock = 0
EndFunc   ;==>oWinsock_OnClose
;
Func oWinsock_OnDataArrival($bytestotal)
   $sbuffer &= $owinsock.GetDataBuffer()
   $total = $bytestotal
EndFunc   ;==>oWinsock_OnDataArrival

HELLLPPPP!

i tried....but nothing...

Link to comment
Share on other sites

- What type of error occurs

- make strong error checking in case of problems

$owinsock = ObjCreate("OSWINSCK.Winsock")
If Not Isobj($owinsock) Then ...

Also look at

$oMyError = ObjEvent("AutoIt.Error","MyErrFunc")   ; Initialize a COM error handler
$owinsock = ObjCreate("OSWINSCK.Winsock")
If @error Then ...

; This is my custom defined error handler
Func MyErrFunc()

  Msgbox(0,"AutoItCOM Test","We intercepted a COM Error !"    & @CRLF  & @CRLF & _
             "err.description is: " & @TAB & $oMyError.description  & @CRLF & _
             "err.windescription:"   & @TAB & $oMyError.windescription & @CRLF & _
             "err.number is: "       & @TAB & hex($oMyError.number,8)  & @CRLF & _
             "err.lastdllerror is: "   & @TAB & $oMyError.lastdllerror   & @CRLF & _
             "err.scriptline is: "   & @TAB & $oMyError.scriptline   & @CRLF & _
             "err.source is: "       & @TAB & $oMyError.source       & @CRLF & _
             "err.helpfile is: "       & @TAB & $oMyError.helpfile     & @CRLF & _
             "err.helpcontext is: " & @TAB & $oMyError.helpcontext _
            )
                Local $err = $oMyError.number
    If $err = 0 Then $err = -1
        SetError($err) ; to check for after this function returns
Endfunc
Link to comment
Share on other sites

in file.vbs

Windows Script Host

---------------------------

54592 08-05-06 13:40:48 50 0 0 606.6 UTC(NIST) *

TotalBytes:51

---------------------------

OK

---------------------------

file.au3

---------------------------

BytesReceived:51

---------------------------

StringLen($sbuffer) = 0

$total = 51

---------------------------

OK

---------------------------

TotalBytesRecived from Au3 = TotalBytesRecived from vbs = 51

but

$sbuffer from au3 = nothing

not equal to

sBuffer from vbs = 54592 08-05-06 13:40:48 50 0 0 606.6 UTC(NIST) *

thanks

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...