473,566 Members | 2,770 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How do I convert GetUserName to Lowercase?

2 New Member
I'm using the following code in a C++ dll to retrieve the windows username of the current logged in user. I'm passing the username to a case sensitive application so I need to convert it to all lower case. Can anyone tell me how to convert acUserName to lowercase?

#include <stdafx.h>
#include <string.h>
#include <cctype>
#include <windows.h>

char acUserName[100];

DWORD nUserName = sizeof(acUserNa me);
GetUserName(acU serName, &nUserName);


Thank you
Oct 8 '07 #1
5 3395
Ganon11
3,652 Recognized Expert Specialist
That's what this function is for. You will have to go through each character to check, though.
Oct 8 '07 #2
Cucumber
90 New Member
Another option could be using CharLower( ), this function has the advantage of taking into account the Locale of the windows user.
Oct 8 '07 #3
jlbess
2 New Member
Another option could be using CharLower( ), this function has the advantage of taking into account the Locale of the windows user.
Worked perfect.


Thank you
Jason
Oct 9 '07 #4
vinay253
3 New Member
hi before converting that you have to use isupper() function it will tell whether that word contains uppercase letters or not.. then you can use charlower() function.
Oct 10 '07 #5
mostafa110
6 New Member
Use below code:
spoonfeeding removed
Oct 11 '07 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

23
25902
by: Hallvard B Furuseth | last post by:
Has someone got a Python routine or module which converts Unicode strings to lowercase (or uppercase)? What I actually need to do is to compare a number of strings in a case-insensitive manner, so I assume it's simplest to convert to lower/upper first. Possibly all strings will be from the latin-1 character set, so I could convert to...
1
4500
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
5
2865
by: Son KwonNam | last post by:
I have some very huge(4~600MB) XML file which is in XML Native database - eXcelon. The problem is that I need to convert all the xml elements' names to lowercase. I think I could do this with XSLT. But the problem is that it's too big XML. Speed doesn't matter.
3
3940
by: casey a | last post by:
Hi all, I would like to take the function below and write the user name to a field on a form and store it in the corresponding table but I'm not sure how to get to where I'm at to where I need to be. I'm doing this to track which user made what entry into the database: Public Declare Function GetComputerName Lib "kernel32" Alias _...
14
3043
by: gilad | last post by:
Hi, I have just released the initial beta of a C# project called 'aumplib'. aumplib is a C# namespace which is made up of a set of classes that interface several prominent open source audio conversion projects via DLL and P/Invoke: LAME (MP3 encoding), libsndfile (non-MP3 audio conversion), and libmad (MP3 decoding; through madlldlib)....
4
11112
by: Robert | last post by:
I am using VB.NET and need to get the user's name that has logged onto the user's computer. In VB6 I used an API call. Is this still the most efficint way or does the .NET framework have an easier, more efficint way of getting the user's name? Many Thanks,
8
20261
by: csanjith | last post by:
Hi, i have a situaion where i need to convert the characters entered in an text field to upper case using C. The configuration id utf8 environment in which user can enter any character (single , double, triple byte etc). I need to convert to upper case only those characters which has got upper case. ie if an user enter bot english and...
22
18194
by: federico_bertola | last post by:
Hi everybody, I have an array of chars that I want to make all lower int Scan(char Search) { char *cPtr; cPtr = strtok (Search," -,."); while (cPtr != NULL) {
6
47267
by: BSHELTON | last post by:
How do I convert existing lowercase data to uppercase in Access 2000? I used the following which did not work? UPDATE HousingTowns SET tMunis=UPPER(tMunis); "HousingTowns" is the table name. "tMunis" is the field name in which the lowercase text is stored in 154 000 rows. I get the error message "Undefined function 'UPPER' in...
0
7584
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...
0
7888
Oralloy
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. ...
0
8108
jinu1996
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...
1
7644
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
1
5484
isladogs
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...
0
3643
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...
0
3626
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2083
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
925
bsmnconsultancy
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...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.