|
TCHAR infoBuf[INFO_BUFFER_SIZE]; //Account Name
DWORD bufCharCount = INFO_BUFFER_SIZE;
if(NULL == GetUserName(infoBuf, &bufCharCount) )
{
DWORD dwRet = GetLastError();
}
thats all;
|
|
|
|
|
Member 3736335 wrote: GetUsername Function
The GetUserName function retrieves the user name of the current thread.
Try the NetUserGetInfo() function retrieves information about a particular user account on a server or NetWkstaUserEnum
Hope this helps
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
Thanks your reply
now i trying to NetUserGetInfo Function , but thats so hard to me~!
hehe
|
|
|
|
|
Did you try to google with NetUserGetInfo keywork. I got this
Sample Here[^]
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
Very Thanks _AnShUmAn_
When i find some information , i can try WNetGetUser Function.
the function is same retrieve logon user name.
so, what is different that WNetGetUser and GetUserName?
|
|
|
|
|
any body has experience with novell edirectory LDAP server from your application ?
if yes,
I want to send multiple asyncronus requests to edirectory LDAP server. when i try send 1000 request at a time, eDir LDAP server accepts only few requests.
How can i tune eDir LDAP server into support huge requests ?
Thanks,
Sakthi
Nice things do nice works
|
|
|
|
|
is there any API is there using which we can done the os provisioning in windows . ??
Can any body tell me how the provisioning of os can be done programmically .
vineesh
|
|
|
|
|
what are you calling "provisionning the OS" ?
|
|
|
|
|
Can you more explain,please?
|
|
|
|
|
provisioning simply means automatically installing and configuring operating systems,
Suppose i have a server machine and some n number of computers connected to it . The server then done a mulitcast to all the members to know which machine is needed a O/S installation . The client machines which are waiting for installation will send back a request to the server .
Then the server needs to install the O/S followed by the system softwares and appln softwares on to the respective machines .
There are two different ways to achieve this
one is a disk cloning
second is a scripted installation
Both disk cloning and unattended scripted installs can be performed remotely using a PXE/DHCP server.
Now my question is whether we are bale to write some APIs for this
remote installations ?
Is it clear now ..?
vineesh
|
|
|
|
|
Be solved by using CWorkbook::SaveAs and CFileDialog.
system
modified on Monday, July 28, 2008 9:29 AM
|
|
|
|
|
|
CApplication app;
...
app.Quit;
system
|
|
|
|
|
Hi,
I found the code below work, but got a problem.
_variant_t var(NULL);
app.Save(var);
If I choose cancel in the SaveAs dialog, the will be an error that says Save method is invalid.
Any suggestion?
system
|
|
|
|
|
hi ,
I have a application to disable buttons .
Example :
There are 50 buttons , If i put 20 in the text box 20 buttons should be shown . Please tell me using ARRAY .
Because i have done it manually i.e
Getdlgitem(id_button)->enablewindow(true);
I need using ARRAY because ,there r 50 buttons know ..
With warm regards
K.Guru moorthy
k.guru moorthy
|
|
|
|
|
The real question is, "Why is your window having 50 buttons on it?".
Anyways, if the IDs of the buttons are sequential, you may run a loop and call EnableWindow(true) from within it.
|
|
|
|
|
v are using for calender appli ,Small buttons .
Say how to do using array
k.guru moorthy
|
|
|
|
|
What array are you talking about? Your controls should have been defined like this:
#define IDC_BUTTON1 1000
#define IDC_BUTTON2 1001
#define IDC_BUTTON3 1002
#define IDC_BUTTON4 1003
#define IDC_BUTTON5 1004
#define IDC_BUTTON6 1005
If they are defined sequentially, then you may run a loop like this to enable or disable them:
for(int i = IDC_BUTTON1; i<= IDC_BUTTON6, ++i)
{
GetDlgItem(i)->EnableWindow(true);
}
|
|
|
|
|
thanks. it works fine
k.guru moorthy
|
|
|
|
|
You must be absolutely sure that you don't have duplicate IDs for your controls (the compiler will warn you though). If you have duplicate IDs, the loop won't go through as you expect it to.
|
|
|
|
|
Well, if the button IDs are contiguous then you simply make an iteration
for (int i=0; i < iEnabledCount; i++)
{
GetDlgItem(ID_BUTTON0 + i)->EnableWindow(TRUE);
}
On the other hand, if the button ID s are sparse, you may use an array:
UINT uBtnId[]= { ID_BUTTON0, ID_BUTTON1, ... };
for (int i=0; i < iEnabledCount; i++)
{
GetDlgItem(uBtnId[i])->EnableWindow(TRUE);
}
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]
|
|
|
|
|
5! Good thing you explained him of using an array - I simply did not get what he was asking to do with an array. Monday is CPMRU rest day, you see.
BTW, I love infinite loops like this:
while(2)
{
}
|
|
|
|
|
Rajesh R Subramanian wrote: BTW, I love infinite loops like this:
while(2)//Be twice as confident!
{
//do stuff here
}
I like the infinite-almost-for-sure ones:
while (! ProtonDecayOccurred )
{
}
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]
|
|
|
|
|
Rajesh R Subramanian wrote: while(2)//Be twice as confident!
hmmm....I don't agree. 2 in binary is still only 1 set bit.
I'd use 3 so if one of the bits fails there's another to fall back on.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hi all,
How CPU usage is calculated under windows?
- Vikram S
|
|
|
|