Hola :
Necesito obtener el nombre de la pc donde se esta ejecutando la aplicacion y al colocar la funcion GetComputerName() me da error y no se crea el ejecutable .
Tengo que agregar alguna libreria extra ?
Uso Hmg 3.046 + Ide
Hello:
I need to get the name of the PC where you are running the application and place the GetComputerName function () it gives me error and creates the executable.
I have to add any additional library?
I use Hmg 3.046 + Ide
Saludos
Mario Mansilla
Funcion GetComputerName()
Moderator: Rathinagiri
-
- Posts: 269
- Joined: Wed Aug 13, 2008 2:35 pm
- Location: Córdoba - Argentina
- danielmaximiliano
- Posts: 2612
- Joined: Fri Apr 09, 2010 4:53 pm
- Location: Argentina
- Contact:
Re: Funcion GetComputerName()
Hola Mario:
estoy utilizando esto en mi aplicacion de red
estoy utilizando esto en mi aplicacion de red
Code: Select all
Public cDefaultUser := GETENV( "UserName" )
Public cDefaulMachine:= GETENV( "COMPUTERNAME" )
*´¨)
¸.·´¸.·*´¨) ¸.·*¨)
(¸.·´. (¸.·` *
.·`. 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
- Pablo César
- Posts: 4059
- Joined: Wed Sep 08, 2010 1:18 pm
- Location: Curitiba - Brasil
Funcion GetComputerName()
Mario, podria disponibilizar el mensaje de error ?Mario Mansilla wrote:Necesito obtener el nombre de la pc donde se esta ejecutando la aplicacion y al colocar la funcion GetComputerName() me da error
Porque yo lo utilizo GetComputerName() sin problemas.
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
- Pablo César
- Posts: 4059
- Joined: Wed Sep 08, 2010 1:18 pm
- Location: Curitiba - Brasil
Funcion GetComputerName()
In the fact in HMG this function there is not present, sorry. But this is not considered as BUG, so please note following code added:
I hope you enjoy it !
Code: Select all
#include <hmg.ch>
Function Main()
MsgInfo(GetComputerName())
MsgInfo(GetUserName())
Return Nil
#pragma BEGINDUMP
#include <windows.h>
#include <lmcons.h>
HB_FUNC( GETUSERNAME )
{
TCHAR lpBuffer[ UNLEN + 1 ];
DWORD nSize = UNLEN;
GetUserName( lpBuffer, &nSize );
hb_retc( lpBuffer );
}
HB_FUNC( GETCOMPUTERNAME )
{
TCHAR lpBuffer[ 129 ];
DWORD nSize = 128;
GetComputerName( lpBuffer, &nSize );
hb_retc( lpBuffer );
}
#pragma ENDDUMP
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
-
- Posts: 269
- Joined: Wed Aug 13, 2008 2:35 pm
- Location: Córdoba - Argentina
Re: Funcion GetComputerName()
Hola Daniel , Pablo :
Perfecto , ambas soluciones funcionan
Muchas gracias
Saludos
Mario Mansilla
Perfecto , ambas soluciones funcionan
Muchas gracias
Saludos
Mario Mansilla