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