Programming Forums

Programming Forums (http://www.programmingforums.org/forumindex.php)
-   Visual Basic (http://www.programmingforums.org/forum18.html)
-   -   VBpcap (http://www.programmingforums.org/showthread.php?t=11056)

Steiner Aug 13th, 2006 2:55 AM

VBpcap
 
Visual Basic 6.0 is not allowing me to use VBPCAP1.0 in my programs I've tried every thing I can think of and I know that winpcap is installed and the VBPCAP.DLL is in the project folder and VBPCAP.BAS is attached. So when I goto run the test program provided or anyother program for that matter, I get "runtime error 49, Bad DLL Calling convention" and when I goto debug it's always on this line of script "vpGetAdapterInfo" so it's not recognizing the call to check for network devices (I think). Am I missing some obvious piece of installation or is something corrupt or any other ideas??

Ooble Aug 13th, 2006 8:40 AM

Taking a look at the VBPCAP 1.0 beta, there are two files named VBPCAPAPI_v1.bas, and none named VBPCAP.BAS. Which one do you mean? Did you write the module yourself?

Steiner Aug 13th, 2006 1:34 PM

VBPCAPAPI_v1.bas is the one in the "test" pogram that came with VBPCAP and it's listed as a module

Ooble Aug 13th, 2006 5:25 PM

Well, here's the definition of the function:

:

Public Declare Function vpGetAdapterInfo Lib "VBPCAP.DLL" (ByVal ID As Integer, ad As AdINFO) As Long

Looks fine to me - anyone see a problem with it?

Steiner Aug 14th, 2006 2:34 AM

that part was already in the module, do I have to change the references or components or something?

john Wesley Aug 14th, 2006 5:05 AM

Looks right to me.

Do you call it like this?, and can we see your use of it?

Steiner Aug 14th, 2006 6:03 PM

does anyone know an alternative to VBPCAP that I can use to make a packet sniffer if I can't get this to work, would rawsockets work at all?

here is the script though:
:

Dim numadapters As Long
Dim i As Integer
Dim d As AdINFO
numadapters = VBPcapInit ' Start VBPCAP engine

For i = 0 To numadapters - 1
vpGetAdapterInfo i, d  'Uncomment this and comment the line above
cbadapter.AddItem d.Description
Next

cbadapter.ListIndex = 0

thanks

Ooble Aug 15th, 2006 7:11 AM

Well, the way the function works, it looks like the variables in the declaration should be ByRef, not ByVal. I can't see how the developer of the library would get something like that wrong though.


All times are GMT -5. The time now is 11:20 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC