Can somebody use the okFrontPanel.DLL with Delphi?

I need to call the okFrontPanelDLL from Delphi, but i can not call the functions, anybody has tried this? Delphi loads the library and gets an address for a function, but when i call the function, i have an Access Violation error, i hope somebody can help me.

Can you distill your problem into a very short piece of code you can include here? It’s really hard to generically debug someone else’s code without looking at anything.

First i use the function:


I have no problems with that. Then, when i try to call the function

‘okUsbFrontPanel_GetDeviceCount’ (which has no parameters also) i have an error like this:
'Access violation at address 00D6439F in module ‘okFrontPanel.dll’ Read of address 00120396

The definitions of both functions are the following:

GetDevice: function: Integer; cdecl;
GetDevice2: function: Integer; cdecl;

And the calls for those functions are:

LibHandle := LoadLibrary(‘okFrontPanel.dll’);
GetDevice := GetProcAddress(LibHandle, ‘okUsbFrontPanel_Construct’);
GetDevice2 := GetProcAddress(LibHandle, ‘okUsbFrontPanel_GetDeviceCount’);

I do not know if i should call the functions in certain order or what is the error. I already post a thread on the Forum.

Thank you for your attention,

Luis Huertas