How To Build ADSI Code in Visual C++

Article translations Article translations
Article ID: 171723 - View products that this article applies to.
This article was previously published under Q171723
Expand all | Collapse all

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.

MORE INFORMATION

An error message of the following type is created when Adsiid.lib is missing from the link libraries:
YOUR_FILE.obj : error LNK2001: unresolved external symbol _IID_IADs*
An error message of the following type is created when Activeds.lib is missing from the link libraries:
YOUR_FILE.obj : error LNK2001: unresolved external symbol [ADS_API@offset] Debug/delete.exe : fatal error LNK1120: 1 unresolved externals Error executing link.exe.

Properties

Article ID: 171723 - Last Review: July 11, 2005 - Revision: 1.3
APPLIES TO
  • Microsoft Platform Software Development Kit-January 2000 Edition
  • Microsoft Active Directory Service Interfaces 2.5
Keywords: 
kbhowto kbapi kbnetwork KB171723

Give Feedback

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com