|
Just go to the end of the file and press ENTER and save it again. Please inform us if it worked or not.
Thank you masters!
|
|
|
|
|
|
Why can't you do that at design time? Or is this range on the second dialog going to be dynamic?
Many are stubborn in pursuit of the path they have chosen, few in pursuit of the goal - Friedrich Nietzsche
.·´¯`·->Rajesh<-·´¯`·.
[Microsoft MVP - Visual C++]
|
|
|
|
|
|
MsmVc wrote: Becouse my Edit Box control on dailog B
So what?! Can you not just edit the dialog B at design time? Are you creating it dynamically?
Do I have to get bits and pieces by asking a thousand questions? Why can't you just give all the relevant information in your first post?
Many are stubborn in pursuit of the path they have chosen, few in pursuit of the goal - Friedrich Nietzsche
.·´¯`·->Rajesh<-·´¯`·.
[Microsoft MVP - Visual C++]
|
|
|
|
|
Deleting your post is RUDE. That makes you look more unprofessional.
Many are stubborn in pursuit of the path they have chosen, few in pursuit of the goal - Friedrich Nietzsche
.·´¯`·->Rajesh<-·´¯`·.
[Microsoft MVP - Visual C++]
|
|
|
|
|
Hi all,
i have this string "random@mail.com", it can also be "email@yahoo.com", basically the string is an email address now how would i eliminate the characters just to get the domain name "mail.com" or "yahoo.com".
Thanks,
Jayjay
|
|
|
|
|
find the @ character position , copy the string from that position to end of the actual string
|
|
|
|
|
Simple function:
int GetDomain (const char *email, char *domain)
{
if (!email || !domain) return -1;
char *c= strchr ((char*)email, '@');
if (!c) return -2;
strcpy (domain, c+1);
return 0;
}
...
char a[100]="";
int e= GetDomain ("sample@domain.es", a);
|
|
|
|
|
const char * getDomain(const char szMail)
{
const char * szDomain;
if (! szMail ) return NULL;
szDomain = szMail +strlen(szMail);
while (szDomain-- != szMail )
{
if (*szDomain == '@') break;
}
if (szDomain==szMail) return NULL;
return ++szDomain;
}
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
I'm leaving error checking and other dodgy stuff to you as an exercise.
const char *szEmail= "myname@mydomain.com";
std::cout<< strstr(szEmail, "@")+1 <<std::endl; Output: mydomain.com
Many are stubborn in pursuit of the path they have chosen, few in pursuit of the goal - Friedrich Nietzsche
.·´¯`·->Rajesh<-·´¯`·.
[Microsoft MVP - Visual C++]
|
|
|
|
|
Rajesh R Subramanian wrote: I'm leaving error checking and other dodgy stuff to you as an exercise.
That's unfair to other competitors
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
CPallini wrote: That's unfair to other competitors
[Chris Tucker voice] I tell ya what: I am an unfair man. [/Chris Tucker voice]
Many are stubborn in pursuit of the path they have chosen, few in pursuit of the goal - Friedrich Nietzsche
.·´¯`·->Rajesh<-·´¯`·.
[Microsoft MVP - Visual C++]
|
|
|
|
|
Rajesh R Subramanian wrote: [Chris Tucker voice] I tell ya what: I am an unfair man. [/Chris Tucker voice]
[Anton Chigurh voice]: You stand to win everything. Call it [/Anton Chigurh voice]
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Good try, i've got another one:
char *email="myemail@mail.com";
char *domain= strchr(email,'@')?strchr(email,'@')+1: 0;

|
|
|
|
|
Welcome to the code obfuscation club. Nah, just kidding.
Nice attempt, BTW.
[add] You know the master of obfuscations[^], right? [/add] Jus' kiddin' Carlo.
Many are stubborn in pursuit of the path they have chosen, few in pursuit of the goal - Friedrich Nietzsche
.·´¯`·->Rajesh<-·´¯`·.
[Microsoft MVP - Visual C++]
|
|
|
|
|
Its simple using CString class
CString sEmail, sDomain;
sEmail = "random@mail.com";
int nPos = sEmail.Find("@");
sDomain = sEmail.Mid(nPos + 1, sEmail.GetLength());
|
|
|
|
|
I am making Win32 application. My need is to determine whether current user has administrative rights or not. Also i need to check how many account exist on system with administrative rights. If no any account exist then create one with administrative rights.
Any help would be greatly appreciated.
Thanks
hemang
|
|
|
|
|
Hemang Raval wrote: My need is to determine whether current user has administrative rights or not.
BOOL IsUserAnAdmin()[^]
Hemang Raval wrote: If no any account exist then create one with administrative rights.
Windows will have at least one administrative account.
Many are stubborn in pursuit of the path they have chosen, few in pursuit of the goal - Friedrich Nietzsche
.·´¯`·->Rajesh<-·´¯`·.
[Microsoft MVP - Visual C++]
|
|
|
|
|
Thanks for reply. Now How would i know about the number of accounts with administrative rights. I want to create another if there exist only one admin account.
BTW, thanks for previous reply. i hope for positive reply for this question also
Regards,
Hemang
|
|
|
|
|
|
Thanks a lot again. I tried to use NetUserEnum. But it gives me the information about every account created on a machine.
My requirement is to get only number of accounts and its information which are having administrator rights.
Thanks in advance. Please help me out.
Thanks
Hemang
|
|
|
|
|
Hemang Raval wrote: My requirement is to get only number of accounts and its information which are having administrator rights.
#1) There is nothing like GetNumberOfAccounts(). However, it should be easy to count the number of accounts yourself with the information NetUserEnum() provides.
#2) For finding if an account has administrative rights, you can use NetUserGetInfo(), which I suggested in my previous post itself.
Many are stubborn in pursuit of the path they have chosen, few in pursuit of the goal - Friedrich Nietzsche
.·´¯`·->Rajesh<-·´¯`·.
[Microsoft MVP - Visual C++]
|
|
|
|
|
A bunch of thanks. I got a clue from your answer and also found solution for getting number of admin account from NetGetUserInfo.
Thanks a lot again.
Regards,
Hemang
|
|
|
|
|
Hemang Raval wrote: Thanks a lot again.
Glad to be of service.
Many are stubborn in pursuit of the path they have chosen, few in pursuit of the goal - Friedrich Nietzsche
.·´¯`·->Rajesh<-·´¯`·.
[Microsoft MVP - Visual C++]
|
|
|
|