FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour UInt32 with "DLL32 Function"
Posts: 4
Joined: Tue Oct 06, 2009 04:22 PM
UInt32 with "DLL32 Function"
Posted: Mon Oct 12, 2009 08:23 PM

Hi All,

Is it possible to use the type unsigned int 32 in the calls "DLL32 FUNCTION" ?

I need to declare the following call in the harbour:

in C#:
[DllImport("PCSHLL32.dll")]
public static extern UInt32 hllapi(out UInt32 Func, StringBuilder Data, out UInt32 Length, out UInt32 RetC);

I tried with several types (WORD, DWORD, LONG, _INT) but without success.

can anybody help me?

thanks

PS: Sorry my english :(

Posts: 9022
Joined: Thu Oct 06, 2005 08:17 PM
Re: UInt32 with "DLL32 Function"
Posted: Mon Oct 12, 2009 09:05 PM

LONG should work. Probably the problem is elsewhere.

EMG

Posts: 4
Joined: Tue Oct 06, 2009 04:22 PM
Re: UInt32 with "DLL32 Function"
Posted: Mon Oct 12, 2009 10:04 PM

Hi, EMG.

Thank you for the answer. I am making the declaration in the following way:

DLL32 FUNCTION _hllapi(@F AS LONG, @D AS STRING, @L AS LONG, @R AS LONG) AS LONG PASCAL FROM "hllapi" LIB "PCSHLL32.dll"
but it doesn't work.
I got to write a dll "wrapper" in C for access the dll "PCSHLL32.dll" without the type uint32, but even so the harbour doesn't get to access.

I will continue trying.

thank you.

Callejas.

Posts: 9022
Joined: Thu Oct 06, 2005 08:17 PM
Re: UInt32 with "DLL32 Function"
Posted: Mon Oct 12, 2009 10:10 PM
Callejas wrote:DLL32 FUNCTION _hllapi(@F AS LONG, @D AS STRING, @L AS LONG, @R AS LONG) AS LONG PASCAL FROM "hllapi" LIB "PCSHLL32.dll"


Try

Code (fw): Select all Collapse
DLL32 FUNCTION HLLAPI(@F AS PTR, @D AS STRING, @L AS PTR, @R AS PTR) AS LONG PASCAL FROM "hllapi" LIB "PCSHLL32.dll"


EMG
Posts: 4
Joined: Tue Oct 06, 2009 04:22 PM
Re: UInt32 with "DLL32 Function"
Posted: Mon Oct 12, 2009 10:35 PM

Hi EMG,

thanks, but it didn't work.

Callejas

Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Re: UInt32 with "DLL32 Function"
Posted: Tue Oct 13, 2009 04:38 AM
Antonio says this in a previous message:

Try it again removing PASCAL from the DLL32 declaration

(In FWH DLL32 is no longer needed. Just use DLL ... as we are in 32 bits)



Regards,
James
FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 9022
Joined: Thu Oct 06, 2005 08:17 PM
Re: UInt32 with "DLL32 Function"
Posted: Tue Oct 13, 2009 07:11 AM

What error do you get exactly?

EMG

Posts: 4
Joined: Tue Oct 06, 2009 04:22 PM
Re: UInt32 with "DLL32 Function"
Posted: Sun Oct 18, 2009 01:59 AM

The problem was in the registration of the dll.
Now it is working correctly.

thank you very much to all

Callejas

Continue the discussion