CardReader

Forum help and suggestions to improve this forum.

Moderator: Rathinagiri

User avatar
srvet_claudio
Posts: 2193
Joined: Thu Feb 25, 2010 8:43 pm
Location: Uruguay
Contact:

Re: CardReader

Post by srvet_claudio »

Hola Daniel.

Sí a nivel de C es fácil pasar por referencia un parámetro.

El problema es que CallDll32() es una función nativa de HMG a nivel PRG que a su vez llama otra función nativa de HMG a nivel C, las cuales no están diseñadas para aceptar parámetros por referencia.

Un abrazo,
Claudio.
Best regards.
Dr. Claudio Soto
(from Uruguay)
http://srvet.blogspot.com
User avatar
danielmaximiliano
Posts: 2611
Joined: Fri Apr 09, 2010 4:53 pm
Location: Argentina
Contact:

Re: CardReader

Post by danielmaximiliano »

srvet_claudio wrote:Hola Daniel.

Sí a nivel de C es fácil pasar por referencia un parámetro.

El problema es que CallDll32() es una función nativa de HMG a nivel PRG que a su vez llama otra función nativa de HMG a nivel C, las cuales no están diseñadas para aceptar parámetros por referencia.

Un abrazo,
Claudio.
Tengo aparte de la DLL (eIDReader.dll) una LIB (eIDReader.lib) pero nose como incluirla y trabajar con ella, pense en transformarla/recompilarla en libeIDReader.a y trabajar como las otras libs de harbour.

tengo el proyecto.SLN para compilar en forma estatica pero nose como hacerlo ya que siempre que quiero compilar con Visual c++ estos tipos de proyectos me dan muchos errores y nose como corregirlos.
*´¨)
¸.·´¸.·*´¨) ¸.·*¨)
(¸.·´. (¸.·` *
.·`. Harbour/HMG : It's magic !
(¸.·``··*

Saludos / Regards
DaNiElMaXiMiLiAnO

Whatsapp. := +54901169026142
Telegram Name := DaNiElMaXiMiLiAnO
User avatar
danielmaximiliano
Posts: 2611
Joined: Fri Apr 09, 2010 4:53 pm
Location: Argentina
Contact:

Re: CardReader

Post by danielmaximiliano »

srvet_claudio wrote:Hola Daniel.

Sí a nivel de C es fácil pasar por referencia un parámetro.

El problema es que CallDll32() es una función nativa de HMG a nivel PRG que a su vez llama otra función nativa de HMG a nivel C, las cuales no están diseñadas para aceptar parámetros por referencia.

Un abrazo,
Claudio.
una consulta claudio, es posible entonces esto que encontre en Fivetech.

Code: Select all


HB_ISBYREF()
Determine if a variable is passed by reference.
Syntax
HB_ISBYREF( @<Var> ) --> <lVarIsByRef>
Argument(s)
@<Var> is the variable to test; it must be passed by reference.
Returns
<lVarIsByRef> a logical value indicating if the variable is passed by reference to actual function or procedure.
Description
This function return a logical value indicating if the variable is passed by reference to actual function or procedure.
ATTENTION: The variable to test must be passed by reference. If the variable is not passed by reference, the function return NIL. This function is based on the form that Harbour manages to the variables for reference. When a variable is passed by reference, what receives the function or procedure is, a pointer to the previous variable, be this the container variable of the data or a pointer to another variable. The function observes if the variable passed points to a common variable or to a variable passed by reference.
Example(s)

See Tests

Test(s)

function Main()
local cVar := "Test local"
private nVar := 0
Test( @cVar, @nVar, cVar, nVar )
return nil
procedure Test( Arg1, Arg2, Arg3, Arg4 )
? hb_isbyref( @Arg1 )        // .T.
? hb_isbyref( @Arg2 )        // .T.
? hb_isbyref( @Arg3 )        // .F.
? hb_isbyref( @Arg4 )        // .F.
return
*´¨)
¸.·´¸.·*´¨) ¸.·*¨)
(¸.·´. (¸.·` *
.·`. Harbour/HMG : It's magic !
(¸.·``··*

Saludos / Regards
DaNiElMaXiMiLiAnO

Whatsapp. := +54901169026142
Telegram Name := DaNiElMaXiMiLiAnO
User avatar
srvet_claudio
Posts: 2193
Joined: Thu Feb 25, 2010 8:43 pm
Location: Uruguay
Contact:

Re: CardReader

Post by srvet_claudio »

danielmaximiliano wrote:una consulta claudio, es posible entonces esto que encontre en Fivetech.


Code:

HB_ISBYREF()
Determine if a variable is passed by reference.
Syntax
HB_ISBYREF( @<Var> ) --> <lVarIsByRef>
Argument(s)
@<Var> is the variable to test; it must be passed by reference.
Returns
<lVarIsByRef> a logical value indicating if the variable is passed by reference to actual function or procedure.
Description
This function return a logical value indicating if the variable is passed by reference to actual function or procedure.
ATTENTION: The variable to test must be passed by reference. If the variable is not passed by reference, the function return NIL. This function is based on the form that Harbour manages to the variables for reference. When a variable is passed by reference, what receives the function or procedure is, a pointer to the previous variable, be this the container variable of the data or a pointer to another variable. The function observes if the variable passed points to a common variable or to a variable passed by reference.
Example(s)

See Tests

Test(s)

function Main()
local cVar := "Test local"
private nVar := 0
Test( @cVar, @nVar, cVar, nVar )
return nil
procedure Test( Arg1, Arg2, Arg3, Arg4 )
? hb_isbyref( @Arg1 )        // .T.
? hb_isbyref( @Arg2 )        // .T.
? hb_isbyref( @Arg3 )        // .F.
? hb_isbyref( @Arg4 )        // .F.
return
Daniel no va a funcionar, hb_isbyref() solo informa si una parámetro es o no pasado por referencia.
La única solución es llamar la librería DLL a nivel de C, con la función LoadLibrary() pero para eso necesitas el archivo de cabecera en C (.h) de la librería para poder llamar correctamente las funciones de la DLL.
Best regards.
Dr. Claudio Soto
(from Uruguay)
http://srvet.blogspot.com
User avatar
danielmaximiliano
Posts: 2611
Joined: Fri Apr 09, 2010 4:53 pm
Location: Argentina
Contact:

Re: CardReader

Post by danielmaximiliano »

Hola Claudio :

no fui muy especifico al publicar el ejemplo, decia esto
@<Var> is the variable to test; it must be passed by reference.
en este caso HB_ISBYREF determina si la variable es pasado por referencia

Code: Select all

HB_ISBYREF( @<Var> )
gracias por la ayuda/consejos que me esta dando
*´¨)
¸.·´¸.·*´¨) ¸.·*¨)
(¸.·´. (¸.·` *
.·`. Harbour/HMG : It's magic !
(¸.·``··*

Saludos / Regards
DaNiElMaXiMiLiAnO

Whatsapp. := +54901169026142
Telegram Name := DaNiElMaXiMiLiAnO
Post Reply