Página 1 de 1
GetUserName() and Default
Publicado: Jue Mar 16, 2006 5:40 pm
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 !!!
GetUserName() and Default
Publicado: Jue Mar 16, 2006 7:10 pm
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
GetUserName() and Default
Publicado: Jue Mar 16, 2006 7:10 pm
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
GetUserName() and Default
Publicado: Vie Mar 17, 2006 11:22 am
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
>
GetUserName() and Default
Publicado: Vie Mar 17, 2006 11:22 am
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
>
GetUserName() and Default
Publicado: Vie Mar 17, 2006 11:50 am
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
GetUserName() and Default
Publicado: Vie Mar 17, 2006 11:50 am
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
GetUserName() and Default
Publicado: Vie Mar 17, 2006 11:52 am
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
GetUserName() and Default
Publicado: Vie Mar 17, 2006 11:52 am
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
GetUserName() and Default
Publicado: Vie Mar 17, 2006 12:04 pm
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
>
GetUserName() and Default
Publicado: Vie Mar 17, 2006 12:04 pm
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
>