HOWTO: Build ADSI Code in Visual C++

Last reviewed: October 10, 1997
Article ID: Q171723
The information in this article applies to:

- Microsoft Win32 Software Development Kit (SDK) on the following

   platforms:
   - Alpha
   - Windows NT
   - Windows 95
   - x86

SUMMARY

The ADSI help files do not specify the header or library files that you need to build ADSI applications in Visual C or Visual C++.

If you are building new code (or using the code snippets in ADSI help), you must include activeds.h, which will pull in the other ADSI header files. The ADSI APIs are Unicode so you should also define UNICODE and _UNICODE before including any system headers (for example, windows.h). If you are using the LDAP provider's OLE DB support you will also need to include oledb.h.

When you link your code you should add adsiid.lib and activeds.lib to your object/library modules settings. If you are using the LDAP provider's OLE DB support you will also need to add oledb.lib.

Keywords          : NtwkADSI
Platform          : NT WINDOWS
Issue type        : kbhowto


================================================================================


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: October 10, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.