S
Sten Westerback
Hi
Can anyone help me understand why i get and how to fix the following
MS VC++ 2003 error message
ReadAD.obj : error LNK2001: unresolved external symbol
_IID_IDirectorySearch
while trying to compile...
CoInitialize(NULL);
if (ADsOpenObject(L"WinNT://NOE/Workstations", p_szU, p_szP,
ADS_READONLY_SERVER, IID_IDirectorySearch, (void **) &p_DS)!=S_OK) return
FALSE;
i=sprintf((char *) szQuery, "(Computer=%s)", p_szPCname);
MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED, (LPCSTR) szQuery, i+1, wszQuery,
sizeof(wszQuery)/sizeof(wszQuery[0]));
if (S_OK != (p_DS->ExecuteSearch(wszQuery, (LPWSTR *) L"ADsPath", 1,
&hADS)))
{ CoUninitialize(); return FALSE; }
// ... other lines here
return TRUE;
What puzzles me is that the IID_IDirectorySearch is declared
as extern in two headers both of which i have included.
ADSIid.h
extern const GUID IID_IDirectorySearch;
Iads.h
EXTERN_C const IID IID_IDirectorySearch;
But obviously that variable isn't defined anywhere such as the
ActiveDS.lib that i have included in the project. So where is it?
The .cpp module is part of a native style Win32 GUI application
which also contains .c modules.
Also, is this the proper method to get the fully qualified domain
name ("path") of a computer object in Active Directory or how
would one do that?
Thanks,
Sten
Can anyone help me understand why i get and how to fix the following
MS VC++ 2003 error message
ReadAD.obj : error LNK2001: unresolved external symbol
_IID_IDirectorySearch
while trying to compile...
CoInitialize(NULL);
if (ADsOpenObject(L"WinNT://NOE/Workstations", p_szU, p_szP,
ADS_READONLY_SERVER, IID_IDirectorySearch, (void **) &p_DS)!=S_OK) return
FALSE;
i=sprintf((char *) szQuery, "(Computer=%s)", p_szPCname);
MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED, (LPCSTR) szQuery, i+1, wszQuery,
sizeof(wszQuery)/sizeof(wszQuery[0]));
if (S_OK != (p_DS->ExecuteSearch(wszQuery, (LPWSTR *) L"ADsPath", 1,
&hADS)))
{ CoUninitialize(); return FALSE; }
// ... other lines here
return TRUE;
What puzzles me is that the IID_IDirectorySearch is declared
as extern in two headers both of which i have included.
ADSIid.h
extern const GUID IID_IDirectorySearch;
Iads.h
EXTERN_C const IID IID_IDirectorySearch;
But obviously that variable isn't defined anywhere such as the
ActiveDS.lib that i have included in the project. So where is it?
The .cpp module is part of a native style Win32 GUI application
which also contains .c modules.
Also, is this the proper method to get the fully qualified domain
name ("path") of a computer object in Active Directory or how
would one do that?
Thanks,
Sten