Winsock Function Question
Hey All,
I wonder if you can help me, I'm making a program, which, can be set to a port number, then, intercept it so any data coming in, out or both can be viewed to screen and logged, without interupting the program using that port.
I had a program that did this once and it was simply Invaluable!!
I have looked through several winsock control mod's but I'm not sure what method I should use to get this information. Please, someone help me with this because the program will be of great use to me once I finish it! :)
Thanx!
Jester
Library: "Wininet" - Function: "InternetGetLastResponse"
Hey's,
It's me again, to help everybody (and myself) get a grip on this subject a bit more. I have found information about this particular API call located in the Wininet Library. I'm pretty sure this will do what I want it to do.
Here is some code I've got for it:
Declare Function InternetGetLastResponseInfo Lib "wininet.dll" Alias "InternetGetLastResponseInfoA" (lpdwError As Long, ByVal lpszBuffer As String, lpdwBufferLength As Long) As Boolean
Private Sub cmdStart_Click()
Call ShowError
End Sub
Sub ShowError()
Dim lErr As Long, sErr As String, lenBuf As Long
'get the required buffer size
InternetGetLastResponseInfo lErr, sErr, lenBuf
'create a buffer
sErr = String(lenBuf, 0)
'retrieve the last respons info
InternetGetLastResponseInfo lErr, sErr, lenBuf
'show the last response info
lstDataLog.AddItem lErr
End Sub
Now, the lErr variable always returns 0, being the length of the last response from the buffer, and if I replace it with "sErr", this is supposably is supposed to return the actual string of this data, but because the length is 0, it returns nothing.
I need two lots of questions answered here.
1) How can I set it so it only looks at one particular port, not just so just one buffer so it takes care of everything?
2) How can I get it so it returns everything? Not just the error's that get written to this buffer?
I would appreciate any and every bit of help is offered, this is sending me round the bend!:rolleyes:
Best Regards,
Jester:cool: