|
Process your command line arguments.
SaRath.
"Where I am from, there is no plan B. So, take advantage of today becuase tomorrow is not promised. - 50 Cent"
My Blog | Understanding State Pattern
|
|
|
|
|
Well the function returns:
If the function succeeds, the return value is NERR_Success.
If the function fails, the return value can be one of the following error codes.
- ERROR_ACCESS_DENIED The user does not have access to the requested information.
- NERR_InvalidComputer The computer name is invalid.
- NERR_UserNotFound The user name could not be found.
So the thing is I hard code the username and the servername is NULL (servername is NULL, the local computer is used.)
But still the function is not equal to NERR_Success, thus it returns a false.
For example:
============
LPWSTR domaincontroller = NULL;
NET_API_STATUS nStatus;
WCHAR *uni_username = NULL;
uni_username =L"richardb"
nStatus = NetUserGetInfo(domaincontroller, uni_username, 3, (LPBYTE*)&buffer);
if(nStatus != NERR_Success){
retval = NULL;
return false;
}else{
return true;
}
}
===========
I have no idea what could be wrong.
David could you plz help or know of a site or something ... anything
Thanx
Regards
Programm3r
|
|
|
|
|
<br />
...<br />
...<br />
GetUserName(lpuser, &dword);<br />
USES_CONVERSION;<br />
nStatus = NetUserGetInfo(NULL, A2W(lpuser), 3, (LPBYTE*)&buffer);<br />
then nStatus =0<br />
|
|
|
|
|
WhiteSky .... you lost me ..
Regards
Programm3r
|
|
|
|
|
Programm3r wrote: eSky .... you lost me ..
offcourse
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
Programm3r wrote: Question: @ DavidCrow
why don't you ask this on the thread you began earlier on the subject ?
why do you want only DavidCrow to answer you ?
why do you think forums are mad for ?
|
|
|
|
|
why don't you ask this on the thread you began earlier on the subject ?
- Well first of all, I have no idea.....
why do you want only DavidCrow to answer you ?
- The question wasn't just indended for him, he was the one how answer the
question, and thus the reason his name appears.
why do you think forums are mad for ?
- ??? mad ???
Thanx for your comments
Regards
Programm3r
|
|
|
|
|
Programm3r wrote: why do you think forums are mad for ?
- ??? mad ???
made
|
|
|
|
|
Besides all that .... do you perhaps have a solotion to my problem?
Regards
Programm3r
|
|
|
|
|
It seems that he think we arent here
why you get (1 vote)+5
|
|
|
|
|
WhiteSky wrote: why you get (1 vote)+5
i don't know... i can't vote for myself, ,so i'm not an actor of this part...
|
|
|
|
|
Never mind .... forget the question .... I'll figure it out.
Regards
Programm3r
|
|
|
|
|
Programm3r wrote: Never mind .... forget the question .... I'll figure it out.
CALM down Buddy... otherwise you will get GOOGLE DEATH!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
Programm3r wrote: David could you plz help or know of a site or something ... anything
Mr David help this guy!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
David is still sleeping at this time
|
|
|
|
|
Yes he helps this guy but now he needs to sleep
|
|
|
|
|
Check you did the following correctly...
Programm3r wrote: WCHAR *uni_username = NULL;
uni_username =L"richardb"
Allocate memory to uni_username and then copy the string...
Programm3r wrote: nStatus = NetUserGetInfo(domaincontroller, uni_username, 3, (LPBYTE*)&buffer);
MSDN says that level 3 is only for servers.. is you pass NULL then your local system should be act as a server..
check what data type your buffer pointing to.. you should use USER_INFO_4
Do your Duty and Don't expect the Result
|
|
|
|
|
Thanx Parthi_Appu, i'll try that.
Cheers
Regards
Programm3r
|
|
|
|
|
hi !!
I am newbie in VC++. I am having problem coverting a time_t varible into LONG data type.
as far as I know time_t is 64 bit int but I have no idea about LONG..
what is the safe way to do that??
|
|
|
|
|
what about type casting?
Regards
Programm3r
|
|
|
|
|
thx for the quick rpl!
I did type casting!!
The compiler agrees on that!
But is it really safe!!! It should not break at run-time.
Also how much byte does LONG takeS??
thx!!
|
|
|
|
|
LONG is 4 bytes.
time_t is now a 64-bit value (unless _USE_32BIT_TIME_T is defined).
"A winner is not one who never fails...but the one who never quits"
|
|
|
|
|
i defined _USE_32BIT_TIME_T in the header file at the top!!
I rebuild the solution.
Still its showing time_t as type int_64 and size 8 bytes.
where am I going wrong!
|
|
|
|
|
sach!! wrote: Also how much byte does LONG takeS??
write this to know :
std::cout << "sizeof(LONG) = " << sizeof(LONG) << endl;
|
|
|
|
|
Thx
That is what i am doing to get the size!!
I need to use 32bit time_t so i declered
#define _USE_32BIT_TIME_T
But its not making any diffence!! I am still getting 8 bytes as a size of time_t var.
|
|
|
|