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.

GetUserName() and Default

Xailer professional forum in English
Responder
Aguiar Costa
Mensajes: 115
Registrado: Jue Jun 01, 2006 7:21 pm

GetUserName() and Default

Mensaje por Aguiar Costa »

Hello,
Can someone tell me what files should i link to use the function
GetUserName()?
And what command ou function replaces the Default commad ?
Thank you.
Aguiar !!!
Avatar de Usuario
jfgimenez
Site Admin
Mensajes: 5706
Registrado: Lun Abr 06, 2015 8:48 pm
Contactar:

GetUserName() and Default

Mensaje por jfgimenez »

Aguiar,
> Can someone tell me what files should i link to use the function
> GetUserName()?
I suppose you need the network username. Place this function into any of
your project's modules:
//---------------------------------------------------------- --------------------
#pragma BEGINDUMP
#include "windows.h"
#include "xailer.h"
XA_FUNC( WNETGETUSER )
{
char cUser[128] = "";
ULONG nLen = 128;
WNetGetUser( NULL, cUser, &nLen );
hb_retc( cUser );
}
#pragma ENDDUMP
//---------------------------------------------------------- --------------------
and call it using:
WNetGetUser() -> cUserName
> And what command ou function replaces the Default commad ?
DEFAULT uVar TO uValue
--
Un saludo,
José F. Giménez
José F. Giménez
[Equipo de Xailer / Xailer team]
http://www.xailer.com
http://www.xailer.info
Avatar de Usuario
jfgimenez
Site Admin
Mensajes: 5706
Registrado: Lun Abr 06, 2015 8:48 pm
Contactar:

GetUserName() and Default

Mensaje por jfgimenez »

Aguiar,
> Can someone tell me what files should i link to use the function
> GetUserName()?
I suppose you need the network username. Place this function into any of
your project's modules:
//---------------------------------------------------------- --------------------
#pragma BEGINDUMP
#include "windows.h"
#include "xailer.h"
XA_FUNC( WNETGETUSER )
{
char cUser[128] = "";
ULONG nLen = 128;
WNetGetUser( NULL, cUser, &nLen );
hb_retc( cUser );
}
#pragma ENDDUMP
//---------------------------------------------------------- --------------------
and call it using:
WNetGetUser() -> cUserName
> And what command ou function replaces the Default commad ?
DEFAULT uVar TO uValue
--
Un saludo,
José F. Giménez
José F. Giménez
[Equipo de Xailer / Xailer team]
http://www.xailer.com
http://www.xailer.info
Aguiar Costa
Mensajes: 115
Registrado: Jue Jun 01, 2006 7:21 pm

GetUserName() and Default

Mensaje por Aguiar Costa »

Hello Jose,
Trying to use wnetgetuser() function i got this error message :
" UTILS.PRG(1) Error F0001 Can't open #include file: 'windows.h'; No such
file or directory "
I have this file on my borland include directory...what am i missing ?
Thanks.
Aguiar !!!
"Jose F. Gimenez" <jfgimenez@wanadoo.es> escreveu na mensagem
news:[email=4419a9fa@ozsrvnegro.ozlan.local...]4419a9fa@ozsrvnegro.ozlan.local...[/email]
> Aguiar,
>
>> Can someone tell me what files should i link to use the function
>> GetUserName()?
>
> I suppose you need the network username. Place this function into any of
> your project's modules:
>
> //---------------------------------------------------------- --------------------
>
> #pragma BEGINDUMP
>
> #include "windows.h"
> #include "xailer.h"
>
> XA_FUNC( WNETGETUSER )
> {
> char cUser[128] = "";
> ULONG nLen = 128;
>
> WNetGetUser( NULL, cUser, &nLen );
>
> hb_retc( cUser );
> }
>
> #pragma ENDDUMP
>
> //---------------------------------------------------------- --------------------
>
> and call it using:
>
> WNetGetUser() -> cUserName
>
>
>> And what command ou function replaces the Default commad ?
>
> DEFAULT uVar TO uValue
>
>
> --
> Un saludo,
>
> José F. Giménez
>
Aguiar Costa
Mensajes: 115
Registrado: Jue Jun 01, 2006 7:21 pm

GetUserName() and Default

Mensaje por Aguiar Costa »

Hello Jose,
Trying to use wnetgetuser() function i got this error message :
" UTILS.PRG(1) Error F0001 Can't open #include file: 'windows.h'; No such
file or directory "
I have this file on my borland include directory...what am i missing ?
Thanks.
Aguiar !!!
"Jose F. Gimenez" <jfgimenez@wanadoo.es> escreveu na mensagem
news:[email=4419a9fa@ozsrvnegro.ozlan.local...]4419a9fa@ozsrvnegro.ozlan.local...[/email]
> Aguiar,
>
>> Can someone tell me what files should i link to use the function
>> GetUserName()?
>
> I suppose you need the network username. Place this function into any of
> your project's modules:
>
> //---------------------------------------------------------- --------------------
>
> #pragma BEGINDUMP
>
> #include "windows.h"
> #include "xailer.h"
>
> XA_FUNC( WNETGETUSER )
> {
> char cUser[128] = "";
> ULONG nLen = 128;
>
> WNetGetUser( NULL, cUser, &nLen );
>
> hb_retc( cUser );
> }
>
> #pragma ENDDUMP
>
> //---------------------------------------------------------- --------------------
>
> and call it using:
>
> WNetGetUser() -> cUserName
>
>
>> And what command ou function replaces the Default commad ?
>
> DEFAULT uVar TO uValue
>
>
> --
> Un saludo,
>
> José F. Giménez
>
Avatar de Usuario
jfgimenez
Site Admin
Mensajes: 5706
Registrado: Lun Abr 06, 2015 8:48 pm
Contactar:

GetUserName() and Default

Mensaje por jfgimenez »

Aguiar,
> Trying to use wnetgetuser() function i got this error message :
> " UTILS.PRG(1) Error F0001 Can't open #include file: 'windows.h'; No such
> file or directory "
>
> I have this file on my borland include directory...what am i missing ?
If you have put the code in a .prg file, please, check that it is guarded
between #pragma BEGINDUMP and #pragma ENDDUMP.
Or put that code in a separate .c file
--
Regards,
Jose F. Gimenez
José F. Giménez
[Equipo de Xailer / Xailer team]
http://www.xailer.com
http://www.xailer.info
Avatar de Usuario
jfgimenez
Site Admin
Mensajes: 5706
Registrado: Lun Abr 06, 2015 8:48 pm
Contactar:

GetUserName() and Default

Mensaje por jfgimenez »

Aguiar,
> Trying to use wnetgetuser() function i got this error message :
> " UTILS.PRG(1) Error F0001 Can't open #include file: 'windows.h'; No such
> file or directory "
>
> I have this file on my borland include directory...what am i missing ?
If you have put the code in a .prg file, please, check that it is guarded
between #pragma BEGINDUMP and #pragma ENDDUMP.
Or put that code in a separate .c file
--
Regards,
Jose F. Gimenez
José F. Giménez
[Equipo de Xailer / Xailer team]
http://www.xailer.com
http://www.xailer.info
Avatar de Usuario
jfgimenez
Site Admin
Mensajes: 5706
Registrado: Lun Abr 06, 2015 8:48 pm
Contactar:

GetUserName() and Default

Mensaje por jfgimenez »

Aguiar,
> If you have put the code in a .prg file, please, check that it is guarded
> between #pragma BEGINDUMP and #pragma ENDDUMP.
BTW, there *must* be a blank line after #pragma BEGINDUMP
--
Regards,
Jose F. Gimenez
José F. Giménez
[Equipo de Xailer / Xailer team]
http://www.xailer.com
http://www.xailer.info
Avatar de Usuario
jfgimenez
Site Admin
Mensajes: 5706
Registrado: Lun Abr 06, 2015 8:48 pm
Contactar:

GetUserName() and Default

Mensaje por jfgimenez »

Aguiar,
> If you have put the code in a .prg file, please, check that it is guarded
> between #pragma BEGINDUMP and #pragma ENDDUMP.
BTW, there *must* be a blank line after #pragma BEGINDUMP
--
Regards,
Jose F. Gimenez
José F. Giménez
[Equipo de Xailer / Xailer team]
http://www.xailer.com
http://www.xailer.info
Aguiar Costa
Mensajes: 115
Registrado: Jue Jun 01, 2006 7:21 pm

GetUserName() and Default

Mensaje por Aguiar Costa »

Jose,
I put the include files at the begining of the prg file...that was the
problem, i did not know that it had to be between #pragma BEGINDUMP and
#pragma ENDDUMP.
Thanks a lot...it's working ok now :)
Regards
Aguiar !!!
"Jose F. Gimenez" <jfgimenez@wanadoo.es> escreveu na mensagem
news:441a94e8$[email=1@ozsrvnegro.ozlan.local...]1@ozsrvnegro.ozlan.local...[/email]
> Aguiar,
>
>> If you have put the code in a .prg file, please, check that it is guarded
>> between #pragma BEGINDUMP and #pragma ENDDUMP.
>
> BTW, there *must* be a blank line after #pragma BEGINDUMP
>
> --
> Regards,
>
> Jose F. Gimenez
>
Aguiar Costa
Mensajes: 115
Registrado: Jue Jun 01, 2006 7:21 pm

GetUserName() and Default

Mensaje por Aguiar Costa »

Jose,
I put the include files at the begining of the prg file...that was the
problem, i did not know that it had to be between #pragma BEGINDUMP and
#pragma ENDDUMP.
Thanks a lot...it's working ok now :)
Regards
Aguiar !!!
"Jose F. Gimenez" <jfgimenez@wanadoo.es> escreveu na mensagem
news:441a94e8$[email=1@ozsrvnegro.ozlan.local...]1@ozsrvnegro.ozlan.local...[/email]
> Aguiar,
>
>> If you have put the code in a .prg file, please, check that it is guarded
>> between #pragma BEGINDUMP and #pragma ENDDUMP.
>
> BTW, there *must* be a blank line after #pragma BEGINDUMP
>
> --
> Regards,
>
> Jose F. Gimenez
>
Responder