473,398 Members | 2,125 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

How do I convert GetUserName to Lowercase?

2
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(acUserName);
GetUserName(acUserName, &nUserName);


Thank you
Oct 8 '07 #1
5 3381
Ganon11
3,652 Expert 2GB
That's what this function is for. You will have to go through each character to check, though.
Oct 8 '07 #2
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
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
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
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
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,...
1
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
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...
3
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...
14
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...
4
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...
8
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 ,...
22
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
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....
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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...
0
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,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
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,...
0
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...

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.