It's working now with the DWORD cast - Thanks!
At 11:00 AM 11/25/2008, you wrote:
Hi,
yes, of cause, you should have a DWORD variable
DWORD lEAX = 0;
hb_retnint( lEAX );
or cast it to DWORD,
LONG lEAX = 0;
hb_retnint( (DWORD) lEAX );
if you want to return DWORD value.
Missing casting
Hi,
yes, of cause, you should have a DWORD variable
DWORD lEAX = 0;
hb_retnint( lEAX );
or cast it to DWORD,
LONG lEAX = 0;
hb_retnint( (DWORD) lEAX );
if you want to return DWORD value.
Missing casting
LONG lEAX = 0;
hb_retnint( lEAX );
or casting it to LONG
LONG lEAX = 0;
hb_r
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
Hi,
so, my previous suggestion should work:
-
PROC main()
? AAA() // prints 40 instead of -294967296
RETURN
#pragma begindump
#include "hbapi.h"
#include "windows.h" /* define DWORD */
HB_FUNC( AAA )
{
DWORDdword = 40; /* more than maxim
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
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 do
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 );
Regard
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.o
Hi all,
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?
Regards,
Randy.
___
Harbour mailing list
Harbour@harbour-project.org
http://lists.harbour-project.org/ma