|
Q. How do I get the user's name and password from within a C++ ISAPI DLL?
A.
Assuming you are using Visual C, bring up the class-wizard (Ctrl-W),
then call CurrentUserName Don't forget to put
HRESULT hresult = OleInitialize(NULL);
AfxEnableControlContainer();
_DAuthXOCX AuthX;
AuthX.CreateDispatch("AUTHXOCX.AuthXOCXCtrl.1");
// AuthX.CreateDispatch("AUTHXISP.AuthXOCXCtrl.1");
in your code before you call the OCX.
Your cgi should have HTTP_AUTHORIZATION passed to it, so be sure to read the docs on CurrentUserName carefully. The correct place to put the CoInitialize in an ISAPI extension is in GetExtensionVersion and CoUninitialize should go in TerminateExtension (so they only get called once.
|
|