Can't use DLL embedded functions...?

Can't use DLL embedded functions...?

Postby giobbi » Sun Feb 06, 2011 6:17 pm

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
giobbi
 
Posts: 6
Joined: Fri Apr 28, 2006 3:14 pm

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

Postby nageswaragunupudi » Sun Feb 06, 2011 7:14 pm

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.
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10316
Joined: Sun Nov 19, 2006 5:22 am
Location: India

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

Postby James Bott » Mon Feb 07, 2011 4:43 pm

Maybe the DLL needs to be registered. Some self-register, some have to be registered.
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

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

Postby giobbi » Mon Feb 07, 2011 7:55 pm

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)
giobbi
 
Posts: 6
Joined: Fri Apr 28, 2006 3:14 pm


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 43 guests