I don't think it is there. I have attached the DLL.. maybe you could look at it and see if I am missing it.

Thanks so much for your help!!
Posted on 2001-10-24 09:01:30 by mikef
What you got there is a .lib file, not a dll :).
Posted on 2001-10-24 09:09:46 by f0dder
Ok.. that makes sense.... how do I correct it???

Here is how I was compiling:

Used Masm32 downloaded from Iczelions site to ASSEMBLE by clicking "Project" then "Assemble ASM file", then copied my files .OBJ, .DEF, .ASM to c:\masm32\bin. Then I typed the following line to link:

link /dll /def:track2.def /subsystem:windows track2.obj

It creates 2 files called track2.lib and track2.exp


What am I missing?? Am I pulling a SUPER NEWBIE here?? :grin:

Thanks again... :alright:
Posted on 2001-10-24 09:12:54 by mikef
Did you check the example I uploaded? That built a working DLL for me :)
Posted on 2001-10-24 09:25:36 by f0dder
I have looked at the dummydll.zip package, but was unable to see how the DLL was made. It seems that the dtest.exe program includes the dummy.lib file in it.. so is the program invoking the dummyproc from the lib that was included or from the actual dummy.dll.

I am going to continue to try and convert this over to the dummy.dll skeleton and see if it can work.

Another thing.. i did the Quick View on the dummy.dll and there was alot of legible text. When I looked at mine it was just a bunch of garbage.

Thanks again to everyone for helping the newbie.:grin:
Posted on 2001-10-24 09:57:32 by mikef
I got the DLL to finally work. I had an error in the .DEF file. Under the LIBRARY I only had trackwx

I changed it to read LIBRARY trackwx.dll

And it created a DLL for me and I am able to call some of the functions from VB now, but they are returning weird results and I get the following error while trying to call the trsetpos routine:

Bad DLL calling convention


Here is what I am using:

Call trsetpos(counter%, value&)

The following have worked so far, just returned unexpected numbers:


Call trinfo (rev%) <------ returns -2152 when it should return 230

Call trchk(baseadr%, retcode%) <--- return -2182 when it should return 0 or 1 in retcode%


Any thoughts on this would help.


Thanks to everyone for getting me past the hardest part... now I just have to get the routines to work the way I expect.


THANKS!!!!!
Posted on 2001-10-24 11:32:14 by mikef
VB passes all arguments as pointers unless you specify ByVal. Make sure your proto expects two DWORD's! Because VB pushes 2 DWORDS and if your proc only cleans up 6 bytes (Dword+Word) it could lead VB to think your proc should be called using the C calling convention. I think VB should be able to read from the dll the correct number of arguments expected though (decorated name), so I don't really get it.

Sorry if this reply is no use at all :grin:
Posted on 2001-10-24 12:51:10 by Qweerdy
Sorry to be such a newbie, but could you explain this one part of your message in Lamer Terms for me:

Make sure your proto expects two DWORD's

I don't understand what proto is.

MY DEF file looks like so:

LIBRARY trackwx.dll
EXPORTS trinfo
EXPORTS trsetadr
EXPORTS trhld

etc...etc...

Do I need to put anything to the right of the Exports line concerning what params are used/passed??

When I try to use the ByVal in my Declare Statement I get VB caused invalid page fault of something like that in trackwx.dll.

But it works the regular way I had it like so:

Private Declare Sub trinfo Lib "c:\windows\desktop\tracker\trackwx.dll" (rev%)

Thanks again!!!
Posted on 2001-10-24 13:09:02 by mikef