winUser() function? ( Solved! )

winUser() function? ( Solved! )

Postby JC » Wed Jan 07, 2009 12:51 pm

Dear friends,

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

Exists any lib to include on my project?
Last edited by JC on Thu Jan 08, 2009 12:00 pm, edited 1 time in total.
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
User avatar
JC
 
Posts: 445
Joined: Thu Feb 21, 2008 11:58 am
Location: Brazil

Re: winUser() function?

Postby StefanHaupt » Wed Jan 07, 2009 5:18 pm

Julio,

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

Code: Select all  Expand view
#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
StefanHaupt
 
Posts: 824
Joined: Thu Oct 13, 2005 7:39 am
Location: Germany

Re: winUser() function?

Postby JC » Wed Jan 07, 2009 6: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
User avatar
JC
 
Posts: 445
Joined: Thu Feb 21, 2008 11:58 am
Location: Brazil

Re: winUser() function?

Postby StefanHaupt » Wed Jan 07, 2009 9: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
StefanHaupt
 
Posts: 824
Joined: Thu Oct 13, 2005 7:39 am
Location: Germany


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 72 guests