|
Hi guys,
is it somehow possible to call the windows password dialog with an API Call
and check if the user entered the correct password ?!?
Or is it possible to get the encrypted password of the user currently logged in??
I want to add a password authentication to my application which uses/checks the
entered password against the users windows password...
Is that somehow possible ?!?
THX
|
|
|
|
|
You can make your own dialog to collect the information, then call LogonUser to validate it. Don't forget to close the handle if it is successful.
|
|
|
|
|
Blake Miller wrote:
...call LogonUser to validate it.
Good idea, but the process that calls LogonUser() must have the SE_TCB_NAME privilege. This is not necessary with Windows XP. Another restriction is that LogonUser() is not available on Windows 9x or ME.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
Nice this works fine
I just needed it for Win2k/WinXP not Win98 so thats OK...
THX
|
|
|
|
|
How about LookupAccountName() ?
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
Well, DarkCloud DID mention he wanted to test the password in the first message... I am curious in what sequence of function calls LookupAccountName would be used to verify the password?
|
|
|
|
|
Blake Miller wrote:
I am curious in what sequence of function calls LookupAccountName would be used to verify the password?
As am I. My post was in reference to someone wanting the domain of the current user. I think it was posted Wednesday or Thursday, but that post has been deleted. It's odd that my post would get (randomly) attached to another thread.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
That would explain a LOT of wierdness in the universe
I did think it odd you would post something seemingly irrelevant to the current thread. So I was indeed curious how that function would have helped.
Thanks
|
|
|
|
|
Hi guys,
I am having problem passing BSTR* parameter into a Visual Basic DLL. Below is the function of that particular DLL:
The sLotID is the parameter that I need to pass in and for the file_name and serr is the parameters passing back from the DLL.
CString _Class1::LotData(BSTR* sLotID, BSTR* file_name, BSTR* serr)
{
CString result;
static BYTE parms[] =
VTS_PBSTR VTS_PBSTR VTS_PBSTR;
InvokeHelper(0x60030008, DISPATCH_METHOD, VT_BSTR, (void*)&result, parms,sLotID, file_name, serr);
return result;
}
In my code, this is what I do:
_Class1 ServerClass;
CString StringReceived = "123456";
BSTR sLotID = StringReceived.AllocSysString();
ProdType=ServerClass.LotData(&sLotID, &file_name, &serr);
Note: The function totally cannot receive the sLotID that I pass in, Please help....
ks tang
AT ENGINEERING
|
|
|
|
|
Dear all,
I run my program using F5 (which will stops in certain line when an error found), and it stops at file CHKSTK.ASM in this highlighted line:
probepages:<br />
sub ecx,_PAGESIZE_ ; yes, move down a page<br />
sub eax,_PAGESIZE_ ; adjust request and...<br />
<br />
<span style="background-color: yellow">test dword ptr [ecx],eax ; ...probe it</span><br />
<br />
cmp eax,_PAGESIZE_ ; more than one page requested?<br />
jae short probepages ; no
I wonder what kind of error that cause this?
Thanks in advance
|
|
|
|
|
The code you posted is not enough to find out what is wrong. What, e.g., is the value ecx gets initialized with?
Don't try it, just do it!
|
|
|
|
|
the ecx value is 206832, and the eax value is 15741120
I don't understand what does the ecx and the eax mean and how it gets initialized.
However, before the debug window bring me to CHKSTK.ASM, the error dialog box said 'Unhandled exception... ..Stack Overflow'.
thanks
|
|
|
|
|
The error said stack overflow.
You are looking in the wrong place.
chkstk.asm is where the program actually ran out of stack memory, but your problem is a design issue.
When the error happens look at the call stack in the debugger to see what function(s) were called to produce the overflow.
You either:
1. Tried to allocate too much memory from the stack.
e.g.
void badfunc( void )
{
long badvar[128*1024];
...
}
or,
2. Got caught in a deep function call loop that ended with the same effect as 1.
e.g. for small values this is fine, for larger values it will blow the stack
long badrecurse( long R )
{
long r = 1; // alloc 4 bytes off stack - each iteration!
if( R > 1 ) r = badrecurse(R-1);
return(R * r);
}
...cmk
Save the whales - collect the whole set
|
|
|
|
|
First of all I have to say that this is my first MFC interface I've ever built for a program that works perfectly under DOS.
The problem is next ... The simulation uses loop that ends only on exit command (something like never-ending loop). Interface is perfect in point that it does what it has to do ... but the problem occurs about the commands ... When I start the program it starts with updateing the interface with the caculations but the commands are not accessible (in fact - they are, but the pressing on them causes the simulation to go to "Not reponding" - it looks like the overloading memory or something like that).
I hope that I decribed it well ... so please help ..
And keep in mind that I am beginner in this kind a programming, so please do not post too complicate solutions
|
|
|
|
|
acinosanduce wrote:
I hope that I decribed it well ... so please help ..
What exactly is it that you need help with?
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
I want to make commands (buttons) on the main window not going to not responding mode ...
More in detail ::
On the main window there are three buttons Start, Pause and Exit ...
On Start it starts the simulation (never-ending loop) and works perfectly in updating data on the window ... but in the same time I'm not able to click on the other buttons like Pause or Exit - because the program stucks (looks like memory overloading or something) ...
So the major question is :: Where did I make a mistake?? What sould I do or implement??
|
|
|
|
|
Your application currently only has one message pump, and it is busy doing whatever the Start button told it to do. You need to create a secondary thread to do this work, thus leaving the primary thread free to handle the UI stuff. See here and here.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
I will check it now ... thanx in advance if it will solve the problem
|
|
|
|
|
In addition to the links suggested by David, see this[^] article, specifically the section "Responding to user input while performing a long task".
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
You need to use threads;
Simply declare global function in your ...Dlg.cpp file :
UINT Thread (LPVOID pParam)
{
//// Here write your loop
for(...)
{
...
}
return 0;
}
and then add doubleclick on the Start button and add this line of code.
{
...
AfxBeginThread(Thread,0);
...
}
you can also manage this thread by changing abovewritten code with this :
CWinThread * thread = AfxBeginThread(Thread,0);
//if you want to pause this thread then use Suspend() func
thread->Suspend();
//to resume it call
thread->Resume();
Good luck
m0n0
|
|
|
|
|
Thanx guys .. I implemented this working thread (somthing like you suggested) .. but I have one another problem ...
In that working thread I am using UpdateData functions ... and the program compiles prefectly, but when I'm starting it I'm getting ::
Debug Assertion Failure!
File: wincore.cpp
Line: 884
Pressing on ignore button repeats the Assert but in the background I can see that aplication runs well.
So, the question is :: what should I write instead of UpdateData(T/F)???
Just to say that application is Dialog based (so it has only one window)!
|
|
|
|
|
Hi, im working on a Single Sing On system using Visual C 6 SP 5.
I need to use the user32 method AllowSetForegroundWindow, only available in newer versions of user32.lib
There is any way i can update the libs and .h included in VC 6?
Thanks in advance
|
|
|
|
|
Kharfax wrote:
There is any way i can update the libs and .h included in VC 6?
Are you using the newest Visual Studio SP and Platform SDK?
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
Im actually downloading the SP6 but dont say anything about updating the included libraries.
My platform SDK, im almost sure is really old, but i cant find it to download.
Maybe is this "Windows® Server 2003 SP1 Platform SDK"?
|
|
|
|
|
Yes... Is that, now i should wait to download 400 MB
Thanks
|
|
|
|