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.
CardReader
Moderator: Rathinagiri
- srvet_claudio
- Posts: 2193
- Joined: Thu Feb 25, 2010 8:43 pm
- Location: Uruguay
- Contact:
- danielmaximiliano
- Posts: 2611
- Joined: Fri Apr 09, 2010 4:53 pm
- Location: Argentina
- Contact:
Re: CardReader
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.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 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
¸.·´¸.·*´¨) ¸.·*¨)
(¸.·´. (¸.·` *
.·`. Harbour/HMG : It's magic !
(¸.·``··*
Saludos / Regards
DaNiElMaXiMiLiAnO
Whatsapp. := +54901169026142
Telegram Name := DaNiElMaXiMiLiAnO
- danielmaximiliano
- Posts: 2611
- Joined: Fri Apr 09, 2010 4:53 pm
- Location: Argentina
- Contact:
Re: CardReader
una consulta claudio, es posible entonces esto que encontre en Fivetech.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.
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
¸.·´¸.·*´¨) ¸.·*¨)
(¸.·´. (¸.·` *
.·`. Harbour/HMG : It's magic !
(¸.·``··*
Saludos / Regards
DaNiElMaXiMiLiAnO
Whatsapp. := +54901169026142
Telegram Name := DaNiElMaXiMiLiAnO
- srvet_claudio
- Posts: 2193
- Joined: Thu Feb 25, 2010 8:43 pm
- Location: Uruguay
- Contact:
Re: CardReader
Daniel no va a funcionar, hb_isbyref() solo informa si una parámetro es o no pasado por referencia.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
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.
- danielmaximiliano
- Posts: 2611
- Joined: Fri Apr 09, 2010 4:53 pm
- Location: Argentina
- Contact:
Re: CardReader
Hola Claudio :
no fui muy especifico al publicar el ejemplo, decia esto
gracias por la ayuda/consejos que me esta dando
no fui muy especifico al publicar el ejemplo, decia esto
en este caso HB_ISBYREF determina si la variable es pasado por referencia@<Var> is the variable to test; it must be passed by reference.
Code: Select all
HB_ISBYREF( @<Var> )
*´¨)
¸.·´¸.·*´¨) ¸.·*¨)
(¸.·´. (¸.·` *
.·`. Harbour/HMG : It's magic !
(¸.·``··*
Saludos / Regards
DaNiElMaXiMiLiAnO
Whatsapp. := +54901169026142
Telegram Name := DaNiElMaXiMiLiAnO
¸.·´¸.·*´¨) ¸.·*¨)
(¸.·´. (¸.·` *
.·`. Harbour/HMG : It's magic !
(¸.·``··*
Saludos / Regards
DaNiElMaXiMiLiAnO
Whatsapp. := +54901169026142
Telegram Name := DaNiElMaXiMiLiAnO