DLL And Visual Basic

Roth, Kevin P. KPRoth@MarathonOil.com
Mon Jan 21 08:54:00 GMT 2002


FWIW - when following exactly the recipe you provided, mine worked OK.
Three
small changes though:

You had this in your VB form:
  Private Declare Function doit Lib "bar.dll" (ByVal ...

However, since the function's name in MyTest.c is testit (not doit), I
added
Alias "testit", like:
  Private Declare Function doit Lib "bar.dll" Alias "testit" (ByVal ...

Second: your script builds "MyTest.dll", not "bar.dll", so I changed
again:
  Private Declare Function doit Lib "MyTest.dll" Alias "testit" (ByVal
...


Third - you called your test function from within Form_Load. This will
only
(normally) run once for any particular form. So, I added a button to
your
form, and moved "i = doit(100)" into the new Button1_Click function.

Works perfectly for me...

You might try compiling to an .EXE and running that, instead of running
inside the VB debugger...

--Kevin

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/



More information about the Cygwin mailing list