Page 1 of 1

Can't use DLL embedded functions...?

Posted: Sun Feb 06, 2011 6:17 pm
by giobbi
Hi folks,

I got a little problem with DLL..
I'm trying to use a DLL calling its functions. It seems the DLL can't be opened with this instruction:
handle:=loadlibrary("pacdrive.dll") or handle:=loadlib32("pacdrive.dll") -> I got handle=0 (should be >32, I guess); if I try to ignore the handle status, the program will crash.

I tried in this way too:
DLL32 Function MYinitialize() AS _INT PASCAL FROM "pacinitialize" LIB "pacdrive.dll", but the program hangs..

The DLL is provided as SDK with an hardware product, with some C++, C#, VB6, etc. samples that correctly work in conjunction with this dll.

How can I make it work in FWH too?

cheers,
Giobbi

Re: Can't use DLL embedded functions...?

Posted: Sun Feb 06, 2011 7:14 pm
by nageswaragunupudi
If it works with VB6, c, c++ it should work with FWH too. First thing is you should be able to loadlibrary. If this is failing probably the dll is corrupted.

Re: Can't use DLL embedded functions...?

Posted: Mon Feb 07, 2011 4:43 pm
by James Bott
Maybe the DLL needs to be registered. Some self-register, some have to be registered.

Re: Can't use DLL embedded functions...?

Posted: Mon Feb 07, 2011 7:55 pm
by giobbi
Solved. More or less, I made in this way;

- I transformed the DLL into a .lib with implib.exe;
- I linked the .lib file;
- I wrote the code for the "clipper call" to a C++ function;

In this way, it seems that the .lib file point to the dll file...

More or less. I worked so long to solve this trouble, that I'm not sure about what I did and what I not..

I'm sure the DLL isn't corrupted.

cheers,
Giovi

btw just for your curiosity: I'm using Fivewin to control custom pinball machines... First experiment went right (you can see the working prototipe in an early stage here: http://www.youtube.com/watch?v=rxeriXfoOSc), so I decided to continue with a most advanced machine. Will tell you more.. :-)
The machine is connected to a Pentium 3 / Win98 PC by parallel cards, gameport, and some commercial, cheap hardware that emulate the keyboard (see ultimarc.com -> iPac) and allow to control the lights by USB. My problem was with this card (see ultimarc.com -> pacdrive64)