In order for this site to work correctly we need to store a small file (called a cookie) on your computer. Most every site in the world does this, however since the 25th of May 2011, by law we have to get your permission first. Please abandon the forum if you disagree.

Para que este foro funcione correctamente es necesario guardar un pequeño fichero (llamado cookie) en su ordenador. La mayoría de los sitios de Internet lo hacen, no obstante desde el 25 de Marzo de 2011 y por ley, necesitamos de su permiso con antelación. Abandone este foro si no está conforme.

how can impemented in a xailer application

Xailer professional forum in English
Responder
Xailer
Mensajes: 328
Registrado: Mar Dic 23, 2008 5:40 pm

how can impemented in a xailer application

Mensaje por Xailer »

Hello to all
I need some help how to call this function from inside an OMF LIBRARY FILE also have the header c file.
The C/C++ Function Defination is the foillowing:
bool WLHardwareGetFormattedID (
int NumCharsToghether,
int Uppercase,
char* pHardwareId);
Parameters
NumCharsTogether
[in] This parameter specifies the number of characters between dashes ('-').
Uppercase
[in] This parameter specifies if the hardware ID must be given in uppercase.
pHardwareId
[out] Pointer to a buffer that will receive a null-terminated string with the formatted hardware ID for the current machine.
How can call the above function from inside a xailer program?
The wanted parameter is pHardwareId
T.I.A
Dionisis Divaris
SGS-soft
Home Page :
Support at :support.sgs@gmail.com[/email]
Avatar de Usuario
jfgimenez
Site Admin
Mensajes: 5718
Registrado: Lun Abr 06, 2015 8:48 pm
Contactar:

how can impemented in a xailer application

Mensaje por jfgimenez »

Dionisis,
> This function is inseide an OMF LIBRARY FILE
> The C/C++ Function Defination is the foillowing:
>
> bool WLHardwareGetFormattedID (
>
> int NumCharsToghether,
>
> int Uppercase,
>
> char* pHardwareId);
>
> How can call the above function from inside a xailer
> program? The wanted parameter is pHardwareId
XA_FUNC( WLHARDWAREGETFORMATTEDID )
{
hb_retl( WLHardwareGetFormattedId( hb_parni( 1 ), hb_parni( 2 ),
hb_parc( 3 ) ) );
}
Regards,
Jose F. Gimenez
http://www.xailer.com
http://www.xailer.info
José F. Giménez
[Equipo de Xailer / Xailer team]
http://www.xailer.com
http://www.xailer.info
Avatar de Usuario
jfgimenez
Site Admin
Mensajes: 5718
Registrado: Lun Abr 06, 2015 8:48 pm
Contactar:

how can impemented in a xailer application

Mensaje por jfgimenez »

Dionisis,
sorry, I forgot to say that that's a C function, callable from PRG code,
so you have to put it into a C file or in a #pragma BEGINDUMP / ENDDUMP
section. Like this:
#pragma BEGINDUMP
#include "windows.h"
#include "xailer.h"
XA_FUNC( WLHARDWAREGETFORMATTEDID )
{
hb_retl( WLHardwareGetFormattedId( hb_parni( 1 ), hb_parni( 2 ),
hb_parc( 3 ) ) );
}
#pragma ENDDUMP
Later, you may call it from PRG code as is it were a xHarbour function.
Regards,
Jose F. Gimenez
http://www.xailer.com
http://www.xailer.info
José F. Giménez
[Equipo de Xailer / Xailer team]
http://www.xailer.com
http://www.xailer.info
Xailer
Mensajes: 328
Registrado: Mar Dic 23, 2008 5:40 pm

how can impemented in a xailer application

Mensaje por Xailer »

Many thanks jose hor your help but i have some issues.
I send to you the header files and lib files (OMF), so maybe you find a solution for me.
When try to link the libs get the following error (see attached image)

Any help appreciated
T.I.A

Attached files Header_LibsC.zip (10.5 KB)Â
Dionisis Divaris
SGS-soft
Home Page :
Support at :support.sgs@gmail.com[/email]
Xailer
Mensajes: 328
Registrado: Mar Dic 23, 2008 5:40 pm

how can impemented in a xailer application

Mensaje por Xailer »

ANY HELP PLEASE ?
T.I.A
Dionisis Divaris
SGS-soft
Home Page :
Support at :support.sgs@gmail.com[/email]
Avatar de Usuario
jfgimenez
Site Admin
Mensajes: 5718
Registrado: Lun Abr 06, 2015 8:48 pm
Contactar:

how can impemented in a xailer application

Mensaje por jfgimenez »

Dionisis,
sorry very much for the long delay. I didn't see your message since I use to read the forums only through news protocol, not via web, and your message failed to syncronize from forum to news.
The problem is that the last character from the function's name is uppercase, not lowercase. Also, you need to 'include' the correct header file. The correct wrapper is:
//------------------------------------------------------------------------------
#pragma BEGINDUMP
#include "windows.h"
#include "xailer.h"
#include "winlicenseSDK.h"
XA_FUNC( WLHARDWAREGETFORMATTEDID )
{
hb_retl( WLHardwareGetFormattedID( hb_parni( 1 ), hb_parni( 2 ), hb_parc( 3 ) ) );
}
#pragma ENDDUMP
//------------------------------------------------------------------------------

BTW, there is a minor problem in that header file which causes BCC to generate an error. To fix it, simply change the line 55 from:
const int wlIsRegisteredAndActivated = wlIsRegistered;
to:
const int wlIsRegisteredAndActivated = 1;
Regards.
José F. Giménez
[Equipo de Xailer / Xailer team]
http://www.xailer.com
http://www.xailer.info
Xailer
Mensajes: 328
Registrado: Mar Dic 23, 2008 5:40 pm

how can impemented in a xailer application

Mensaje por Xailer »

Many thanks for your help
I still have problems. I get the message 'Unable to open file SECUREENGINESDK32.LIB'. This librarry already attached to the project via IDE Project->properties->Libraries
see attach foto
T.I.A
Dionisis

Attached files
Dionisis Divaris
SGS-soft
Home Page :
Support at :support.sgs@gmail.com[/email]
Avatar de Usuario
jfgimenez
Site Admin
Mensajes: 5718
Registrado: Lun Abr 06, 2015 8:48 pm
Contactar:

how can impemented in a xailer application

Mensaje por jfgimenez »

Dionisis,
> Many thanks for your help I still have problems. I get the message
> 'Unable to open
> file SECUREENGINESDK32.LIB'. This librarry already attached
> to the project via IDE Project->properties->Libraries
The problem is that the header files forzes the linker to link both
libraries, but without specifing their path. You have two possible
solutions:
1) Edit both header files and delete (or comment) the lines #pragma
comment(lib,...) to avoid that behavior.
2) Add the path where the libraries resides to your project. In the page
"BCC++", box "Linker", edit "More options", put -L[path] (where [path]
is the path where the libraries are).
Regards,
Jose F. Gimenez
http://www.xailer.com
http://www.xailer.info
José F. Giménez
[Equipo de Xailer / Xailer team]
http://www.xailer.com
http://www.xailer.info
Xailer
Mensajes: 328
Registrado: Mar Dic 23, 2008 5:40 pm

how can impemented in a xailer application

Mensaje por Xailer »

Many thanks Jose work's like a charm
All the best
Dionisis Divaris
SGS-soft
Home Page :
Support at :support.sgs@gmail.com[/email]
Xailer
Mensajes: 328
Registrado: Mar Dic 23, 2008 5:40 pm

how can impemented in a xailer application

Mensaje por Xailer »

and at last how can traslate the following into extend xHarbour API:
void WLGetVersion(char* pBuffer);

T.I.A
Dionisis Divaris
SGS-soft
Home Page :
Support at :support.sgs@gmail.com[/email]
Avatar de Usuario
jfgimenez
Site Admin
Mensajes: 5718
Registrado: Lun Abr 06, 2015 8:48 pm
Contactar:

how can impemented in a xailer application

Mensaje por jfgimenez »

Dionisis,
> and at last how can traslate the following into extend
> xHarbour API:
> void WLGetVersion(char* pBuffer);
//---------------------------------------------------------- --------------------
XA_FUNC( WLGETVERSION )
{
char cVersion[ 256 ];
WLGetVersion( cVersion );
hb_retc( cVersion );
}
//---------------------------------------------------------- --------------------
I've assumed that 256 bytes is large enough to receive the string. If
not, just increase it.
Also, this wrapper returns the string, and has no parameter at all. That
is, you have to use it as:
cVersion := WLGetVersion()
Regards,
Jose F. Gimenez
http://www.xailer.com
http://www.xailer.info
José F. Giménez
[Equipo de Xailer / Xailer team]
http://www.xailer.com
http://www.xailer.info
Responder