Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>An old peace of code, I'am not able to test, so given As is :</p> <pre><code>//--------------------------------------------------------- // quick ADSI sample - binding to a user //--------------------------------------------------------- //--------------------------------------------------------- // should use unicode - saves a lot of conversion work //--------------------------------------------------------- #define _UNICODE //--------------------------------------------------------- // libraries needed to use ADSI //--------------------------------------------------------- #pragma comment( lib, "Activeds.lib" ) #pragma comment( lib, "Adsiid.lib" ) //--------------------------------------------------------- // ADSI header //--------------------------------------------------------- #include &lt;activeds.h&gt; int wmain( int argc, wchar_t *argv[] ) { //----------------------------------------------------- // HRESULT hr is the return code value from all ADSI // calls - using the SUCCEEDED MACRO to check for // success //----------------------------------------------------- HRESULT hr; //----------------------------------------------------- // pointer to our IADsUser object //----------------------------------------------------- IADsUser *pUser = NULL; //----------------------------------------------------- // path to the user we are going to try to update // make sure you replace this with something // specific to your environment // Form : WinNT://&lt;domain name&gt;/&lt;object name&gt;,&lt;object class&gt; //----------------------------------------------------- LPWSTR pszADsPath = L"WinNT://yourdomain/object name,user"; // // See available forms : // http://msdn.microsoft.com/en-us/library/aa746534(v=VS.85).aspx //----------------------------------------------------- // intialize the COM subsystem before doing any work //----------------------------------------------------- CoInitialize(NULL); //----------------------------------------------------- // try to get the user // http://msdn.microsoft.com/en-us/library/aa772184(v=VS.85).aspx //----------------------------------------------------- hr = ADsGetObject(pszADsPath, IID_IADsUser,(void**)&amp;pUser); // Here Test hr //http://msdn.microsoft.com/en-us/library/aa772195(v=VS.85).aspx //----------------------------------------------------- // kill the COM subsystem we were using //----------------------------------------------------- CoUninitialize(); return 0; } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload