AzKay Posted April 6, 2008 Share Posted April 6, 2008 (edited) expandcollapse popup$oMyError = ObjEvent("AutoIt.Error", "COMErrFunc") $WinSock = ObjCreate("MSWinsock.Winsock.1") $oX = ObjEvent($WinSock, "Sock_") $WinSock.Connect("127.0.0.1", 65432) Do Until $WinSock.State = 7 AdlibEnable("Sock_DataArrival", 1) $WinSock.SendData("hi") While 1 ;Sleep(10) WEnd $WinSock.Close Func Sock_DataArrival() ;$totalBytes $strData = "" $WinSock.GetData($strData) If $strData <> "" Then ConsoleWrite($strData & @CRLF) EndFunc Func COMErrFunc() 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 Exit EndFunc ;==>COMErrFuncoÝ÷ Ù'«½êÚºÚ"µÍÔÑTTÌÌÎÉÌÌÎÈÝYHÝ ÌÌÎÉÌÌÎÉÌÌÎÉÌÌÎÉÌÌÎÉÌÌÎÉÌÌÎÉÌÌÎÉÌÌÎÉÌÌÎÉÌÌÎÉÌÌÎÉÌÌÎÉÌÌÎÉÌÌÎÂÌÍÙ×ÒTH ][ÝÌLËI][ÝÂÈÝHÔÙXÙÂÏOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOBÔÝ BÈÜX]HHÝ[[È ][ÝÔÓÐÒÑU ][ÝÂÏOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOBÌÍÓXZ[ÛØÚÙ]HÔÝ[ ÌÍÙ×ÒT MÌL BY ÌÍÓXZ[ÛØÚÙ]HLH[^]ÈÛÚÈÜÛY[ÛÛXÝ[ÛËKKKKKKKKKKKKKKKKKKKBÚ[HBÌÍÐÛÛXÝYÛØÚÙ]HÔXØÙ ÌÍÓXZ[ÛØÚÙ] BY ÌÍÐÛÛXÝYÛØÚÙ] ÝÏH[ÙØÞ ][ÝÉ][ÝË ][ÝÛ^HÙHÛY[ÛÛXÝY ][ÝÊB^]ÛÜ[YÙ[Ú[HBIÌÍÛÔXÝHÔXÝ ÌÍÐÛÛXÝYÛØÚÙ] JBRY ÌÍÛÔXÝ ÉÝÈ ][ÝÉ][ÝÈ[BNÓÙÐÞ ][ÝÉ][ÝË ÌÍÛÔXÝBBUÔÙ[ ÌÍÐÛÛXÝYÛØÚÙ] ][ÝÜÙÙÙÉ][ÝÊBQ[YÑ[GetData reference.GetData VB6 example.According the the example there, it GetData should be working.But it isnt. I tried with the event, and a adlib.Any ideas? Edited April 6, 2008 by AzKay # MY LOVE FOR YOU... IS LIKE A TRUCK- # Link to comment Share on other sites More sharing options...
AzKay Posted April 6, 2008 Author Share Posted April 6, 2008 And if you dont have the WinSock control, I believe it can be found HERE. # MY LOVE FOR YOU... IS LIKE A TRUCK- # Link to comment Share on other sites More sharing options...
AzKay Posted April 6, 2008 Author Share Posted April 6, 2008 "Bump". # MY LOVE FOR YOU... IS LIKE A TRUCK- # Link to comment Share on other sites More sharing options...
AzKay Posted April 7, 2008 Author Share Posted April 7, 2008 "Bump". # MY LOVE FOR YOU... IS LIKE A TRUCK- # Link to comment Share on other sites More sharing options...
AzKay Posted April 7, 2008 Author Share Posted April 7, 2008 Bump. # MY LOVE FOR YOU... IS LIKE A TRUCK- # Link to comment Share on other sites More sharing options...
evilertoaster Posted April 7, 2008 Share Posted April 7, 2008 AzKay, from what I understand this code should work- expandcollapse popup;client dim $sBuffer $oMyError = ObjEvent("AutoIt.Error", "COMErrFunc") $WinSock = ObjCreate("MSWinsock.Winsock.1") $oX = ObjEvent($WinSock, "Sock_") $WinSock.Connect("127.0.0.1", 1000) Do Until $WinSock.State = 7 $WinSock.SendData("hi") While 1 Sleep(100) WEnd $WinSock.Close Func Sock_DataArrival($total) $WinSock.GetData($sBuffer) EndFunc Func COMErrFunc() 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 Exit EndFunc ;==>COMErrFuncoÝ÷ Ù«¢+ÙQ AMÑÉÑUÀ ¤(ÀÌØí5¥¹M½ÐôQ A1¥ÍѸ ÅÕ½ÐìÄÈܸÀ¸À¸ÄÅÕ½Ðì°ÄÀÀÀ¤)%ÀÌØí5¥¹M½Ðô´ÄQ¡¸á¥Ð()]¡¥±Ä($ÀÌØí ½¹¹ÑM½ÐôQ AÁÐ ÀÌØí5¥¹M½Ð¤(%%ÀÌØí ½¹¹ÑM½ÐÐìôÀQ¡¸($%µÍ½à À°ÅÕ½ÐìÅÕ½Ðì°ÅÕ½ÐíµäÍÉÙÈ´ ±¥¹Ð ½¹¹ÑÅÕ½Ðì¤($%á¥Ñ1½½À(%¹%)]¹()]¡¥±Ä(ÀÌØí½IØôQ AIØ ÀÌØí ½¹¹ÑM½Ð°ÈÀÐÔ¤(%ÀÌØí½IرÐìÐìÅÕ½ÐìÅÕ½ÐìQ¡¸(Q AM¹ ÀÌØí ½¹¹ÑM½Ð°ÅÕ½ÐíÍÍÍÌÅÕ½Ðì¤(¹%)]¹oÝ÷ Ø×hzÉ÷öÒÊç$Ó~¢Ö¥{ayëÞØZÙ^®Øhºr¢íý[z+HJ¶)à¶«mu«Z"Ýý²,²&åzØb²+nèØhºb·lj[(¦,¹^Áíýë"rv§+p®à¶«yªÞ²«±ç±jjezËh~Ø¢é˧¶Ú+z+µ«,¹ÈZÛ{Z¶Ø^ÊØbJÒ'µê޲ا¢*.¶¼¢ëjv«¬²Ø^ç"z÷«nçßz¶®¶sfFÒb33c·4'VffW%³#Тb33c¶ô×W'&÷"Òö&¤WfVçBgV÷C´WFôBäW'&÷"gV÷C²ÂgV÷C´4ôÔW'$gVæ2gV÷C²¢b33cµvå6ö6²Òö&¤7&VFRgV÷C´Õ5vç6ö6²åvç6ö6²ãgV÷C²¢b33c¶õÒö&¤WfVçBb33cµvå6ö6²ÂgV÷Cµ6ö6µògV÷C²¢b33cµvå6ö6²ä6öææV7BgV÷C³#rãããgV÷C²Â ¤Fð¥VçFÂb33cµvå6ö6²å7FFRÒp ¢b33cµvå6ö6²å6VæDFFgV÷C¶gV÷C² ¥vÆR¢6ÆVW¥tVæ@ ¢b33cµvå6ö6²ä6Æ÷6P ¤gVæ26ö6µôFF'&fÂb33c·F÷F b33cµvå6ö6²ävWDFFb33c·4'VffW"¤VæDgVæ0 ¤gVæ24ôÔW'$gVæ2¢×6t&÷ÂgV÷C´WFôD4ôÒFW7BgV÷C²ÂgV÷CµvRçFW&6WFVB4ôÒW'&÷"b333²gV÷C²fײ5$Äbfײ5$Äbfײð¢gV÷C¶W'"æFW67&Föâ3¢gV÷C²fײD"fײb33c¶ô×W'&÷"æFW67&Föâfײ5$Äbfײð¢gV÷C¶W'"çvæFW67&Föã¢gV÷C²fײD"fײb33c¶ô×W'&÷"çvæFW67&Föâfײ5$Äbfײð¢gV÷C¶W'"æçVÖ&W"3¢gV÷C²fײD"fײWb33c¶ô×W'&÷"æçVÖ&W"Âfײ5$Äbfײð¢gV÷C¶W'"æÆ7FFÆÆW'&÷"3¢gV÷C²fײD"fײb33c¶ô×W'&÷"æÆ7FFÆÆW'&÷"fײ5$Äbfײð¢gV÷C¶W'"ç67&FÆæR3¢gV÷C²fײD"fײb33c¶ô×W'&÷"ç67&FÆæRfײ5$Äbfײð¢gV÷C¶W'"ç6÷W&6R3¢gV÷C²fײD"fײb33c¶ô×W'&÷"ç6÷W&6Rfײ5$Äbfײð¢gV÷C¶W'"æVÇfÆR3¢gV÷C²fײD"fײb33c¶ô×W'&÷"æVÇfÆRfײ5$Äbfײð¢gV÷C¶W'"æVÇ6öçFWB3¢gV÷C²fײD"fײb33c¶ô×W'&÷"æVÇ6öçFWBð¢¢Æö6Âb33c¶W'"Òb33c¶ô×W'&÷"æçVÖ&W ¢bb33c¶W'"ÒFVâb33c¶W'"ÒÓ¢6WDW'&÷"b33c¶W'"²Fò6V6²f÷"gFW"F2gVæ7Föâ&WGW&ç0¢W@¤VæDgVæ2³ÓÒfwC´4ôÔW'$gVæ0 It hard crashes, which seems odd (com error maybe, but not a hard crash)... this was assuming that it might be a byte-array or somthing but it isn't. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now