Prev   Next

Back to the top of the FAQ

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),
Click on Add Class/From a Type library,
Select authxocx.ocx
Click OK.

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.

Back to the top of the FAQ

Prev   Next