Hi,
I have a tool which is made in C and uses the API GetUserName(). But we have the problem as the user says it gives incorrect username "sometimes" .
When the failure occurs, the username. that is retrieved is a valid but one not belonging to the logged on user. For example the staff number retrieved is 04982479, but when a failure occurs with the same user, instead of retrieving 04982479, another (valid) username is returned.
Is there anyt other API which I can use so as that logon name can be retrieved.?
Please help,
regards,
Venu
5 3169 gpraghuram 1,275
Recognized Expert Top Contributor
This API is specific to windows...
Dis u search in the MSDN to know the bugs in the API?
Raghu
This API is specific to windows...
Dis u search in the MSDN to know the bugs in the API?
Raghu
HI Raghu,
Yes I did, MSDN talks something like this, "If the current thread is impersonating another client, the GetUserName function returns the user name of the client that the thread is impersonating."
My tools runs only on windows. I need an alternative to this API for windows only. Could you please suggest me any ?
regards,
Venu
gpraghuram 1,275
Recognized Expert Top Contributor
Hi,
I am not very good in Windows programming and so i wont be in a position to answer this
raghu
For win32 api, just ask on Advanced Win32 api newsgroup :
news://194.177.96.26/comp.os.ms-windows.program mer.win32
For win32 api, just ask on Advanced Win32 api newsgroup :
news://194.177.96.26/comp.os.ms-windows.program mer.win32
Thanks for the feedback George.
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: smj92I |
last post by:
Hello
How to get the name of the user logged in the server side, is there
something like GetUserName?
Thanks
|
by: jack |
last post by:
Hi everyone,
In VB.NET, is getting the network username still the same as VB 6.0, i.e.
using the the following API:
Private Declare Function GetUserName Lib "advapi32.dll" Alias "GetUserNameA"
(ByVal lpBuffer As String, ByRef nSize As Integer) As Integer
Or, is there a way to do this using the .NET Framewrork?
Thanks!
|
by: **Developer** |
last post by:
I have a control called MyPanel that inherits from Panel.
Also a control called MyRTB that inherits from RichTextBox.
They are used on a form as follows:
MyPanel in on the form and MyRTF is placed in MyPanel.
I do this so that the properties of MyRTF and of MyPanel are available to
the form.
|
by: Diana |
last post by:
I thought I had this process pretty well down pat, but I'm getting a
syntax error on the following code:
*****Code*****
'Check for users - can't get this to work...
Dim strUser As String
strUser = WUserName()
If IsNull(DLookup("Permitted", "tblUsers", "Permitted = '" &
|
by: bsruth |
last post by:
I tried for an hour to find some reference to concrete information on
why this particular inheritance implementation is a bad idea, but
couldn't. So I'm sorry if this has been answered before. Here's the
scenario:
We have a base class with all virtual functions. We'll call this the
Animal class. We then make two classes Fish and Bird that both inherit
from Animal. In the program, we have a single array of Animal pointers
that will...
| |
by: lovecreatesbea... |
last post by:
K&R 2, sec. 5.11 says that no need to precede function and array names
with address-of operators &, why?
|
by: sunbeam |
last post by:
Short Description of the Project:
we developed a e-learning system for our students. each student has a unique username/password to view the modules he/she should view and nothing more. since we want to give them the opportunity to run these modules from home as well, we are trying to get the USERNAME/COMPUTERNAME as well, so the students, when they sign up for the modules, they can ONLY run the modules fromhome PC.
We found a nice...
|
by: vijaykumardahiya |
last post by:
Hello Sir,
I have a simple Issue but It is not resolve by me i.e input parameter
are not store in Ms-Access.
I store the input parameter through Standard Action <jsp:useBean>.
jsp:useBean call a property IssueData. this property exist in
SimpleBean which create a connection from DB and insert the data.
At run time servlet and server also show that loggging are saved in DB.
But when I open the table in Access. Its empty.
Ms-Access have...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
| |
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
|
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |