FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour winUser() function? ( Solved! )
Posts: 445
Joined: Thu Feb 21, 2008 11:58 AM
winUser() function? ( Solved! )
Posted: Wed Jan 07, 2009 12:51 PM
Dear friends,

I want to use the function winUser() but I retrieve this error:
Error: Unresolved external '_HB_FUN_WINUSER' referenced from OBJ\MAIN.OBJ

Exists any lib to include on my project?
Peace and lighting!

Júlio César M. Ferreira

FWH 8.10 / xHB 1.1.0 / xDevStudio 0.72 / Pelles C 5.0.1 / SQLLIB 1.9
Posts: 824
Joined: Thu Oct 13, 2005 07:39 AM
Re: winUser() function?
Posted: Wed Jan 07, 2009 05:18 PM
Julio,

the WinUser() function should be in msgbox.c from FWH, but you can also use this function

#pragma BEGINDUMP

#include <windows.h>
#include <hbapi.h>

// BOOL GetUserName( LPTSTR lpBuffer, LPDWORD nSize );
// 
//http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sysinfo/base/getusername.asp

HB_FUNC ( GETUSERNAME )
{
   TCHAR lpBuffer[255];
   DWORD nSize = 255;
   GetUserName( lpBuffer, &nSize );
   hb_retc( lpBuffer );
}

#pragma ENDDUMP
kind regards

Stefan
Posts: 445
Joined: Thu Feb 21, 2008 11:58 AM
Re: winUser() function?
Posted: Wed Jan 07, 2009 06:21 PM

Stefan,

Thank for you answer!
I tried to use wNetGetUser()... are it return the same user!?

Peace and lighting!

Júlio César M. Ferreira

FWH 8.10 / xHB 1.1.0 / xDevStudio 0.72 / Pelles C 5.0.1 / SQLLIB 1.9
Posts: 824
Joined: Thu Oct 13, 2005 07:39 AM
Re: winUser() function?
Posted: Wed Jan 07, 2009 09:06 PM
Julio,

I tried to use wNetGetUser()... are it return the same user!?


yes, it does. Both return the current user name.

Additionally wNetGetUser (cNetworkResourceName) can return the user name used to establish a network connection if you specify the parameter.
kind regards

Stefan

Continue the discussion