Hi Mindaugas,
Yes, that works - I was casting incorrectly at the C level. However,
I have to cast as DWORD (not LONG) to get it to work. Here is what I am doing:
LONG lEAX = 0;
...
_asm{mov lEAX, eax}
...
hb_retnint( (DWORD) lEAX );
As you can see, lEAX is set from the call stack via an _asm call -
When I call hb_retnint(), I have to cast lEAX as a DWORD for it to
work properly (LONG does not work).
Does this seem correct to you?
TIA.
Regards,
Randy.
At 05:21 PM 11/24/2008, you wrote:
Hi,
so, my previous suggestion should work:
---------------------------------
PROC main()
? AAA() // prints 4000000000 instead of -294967296
RETURN
#pragma begindump
#include "hbapi.h"
#include "windows.h" /* define DWORD */
HB_FUNC( AAA )
{
DWORD dword = 4000000000; /* more than maximum LONG value */
hb_retnint( (HB_LONG) dword );
}
#pragma enddump
---------------------------------
Best reagards,
Mindaugas
Randy Portnoff wrote:
This becomes an issue when I am calling DLL functions using
GetProcAddress/CallDLL - Sometimes, a DLL has a DWORD return value.
However, since Harbour does not seem to support this, a LONG is
returned which sometimes can be negative (which is not valid for a
DWORD). So, I then have to add 2^32 to that value to convert it to
a DWORD. I thought it would be nice to get this hack out of the PRG
code by properly supporting DWORD in the HBAPI.
At 03:00 PM 11/24/2008, you wrote:
Hi,
then I should ask you, how do you know on prg level, if it is LONG or not?
Regards,
Mindaugas
Randy Portnoff wrote:
Hi Mindaugas,
Thanks, but it still returns a LONG.
Regards,
Randy.
At 05:15 PM 11/21/2008, you wrote:
Hi,
Is there a way to return a DWORD value using HBAPI.H or does
this conversion (ie. from LONG to DWORD) need to be done at the PRG level?
Try
hb_retnint( (HB_LONG) dword );
Regards,
Mindaugas
_______________________________________________
Harbour mailing list
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour
_______________________________________________
Harbour mailing list
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour