Include for IID's ?
-
i use following code
#include <Iads.h> #include <Adshlp.h> #pragma comment(lib, "ActiveDS.Lib") #include <COMDEF.H> bool CheckUserADSI(const char* parUserName, const char* parCode) { IADsOpenDSObject* pObject = NULL; IDispatch* pDisp = NULL; bool RetValue = false; HRESULT hr = S_OK; _bstr_t UserName (parUserName); _bstr_t Code (parCode); // hr = ADsGetObject(L"LDAP:", IID_IADsOpenDSObject, (void**) &pObject); hr = ADsGetObject(L"LDAP:", IID_IADsUser, (void**) &pObject); if (SUCCEEDED(hr)) { hr = pObject->OpenDSObject(L"LDAP://net.blum",UserName, Code, ADS_SECURE_AUTHENTICATION, &pDisp); pObject->Release(); if (SUCCEEDED(hr)) { RetValue = true; } } pDisp = NULL; pObject = NULL; return RetValue; }
when i compile the code, the compiler says: WinLogon.obj : error LNK2001: unresolved external symbol _IID_IADsUser Any ideas how to solve this problem ? I've checked the platform SDK samples.. all are using this IID.. but i haven't seen a single include or lib file they were linking..
"I'm from the South Bronx, and I don't care what you say: those cows look dangerous."
U.S. Secretary of State Colin Powell at George Bush's ranch in Texas -
i use following code
#include <Iads.h> #include <Adshlp.h> #pragma comment(lib, "ActiveDS.Lib") #include <COMDEF.H> bool CheckUserADSI(const char* parUserName, const char* parCode) { IADsOpenDSObject* pObject = NULL; IDispatch* pDisp = NULL; bool RetValue = false; HRESULT hr = S_OK; _bstr_t UserName (parUserName); _bstr_t Code (parCode); // hr = ADsGetObject(L"LDAP:", IID_IADsOpenDSObject, (void**) &pObject); hr = ADsGetObject(L"LDAP:", IID_IADsUser, (void**) &pObject); if (SUCCEEDED(hr)) { hr = pObject->OpenDSObject(L"LDAP://net.blum",UserName, Code, ADS_SECURE_AUTHENTICATION, &pDisp); pObject->Release(); if (SUCCEEDED(hr)) { RetValue = true; } } pDisp = NULL; pObject = NULL; return RetValue; }
when i compile the code, the compiler says: WinLogon.obj : error LNK2001: unresolved external symbol _IID_IADsUser Any ideas how to solve this problem ? I've checked the platform SDK samples.. all are using this IID.. but i haven't seen a single include or lib file they were linking..
"I'm from the South Bronx, and I don't care what you say: those cows look dangerous."
U.S. Secretary of State Colin Powell at George Bush's ranch in Texas -
i use following code
#include <Iads.h> #include <Adshlp.h> #pragma comment(lib, "ActiveDS.Lib") #include <COMDEF.H> bool CheckUserADSI(const char* parUserName, const char* parCode) { IADsOpenDSObject* pObject = NULL; IDispatch* pDisp = NULL; bool RetValue = false; HRESULT hr = S_OK; _bstr_t UserName (parUserName); _bstr_t Code (parCode); // hr = ADsGetObject(L"LDAP:", IID_IADsOpenDSObject, (void**) &pObject); hr = ADsGetObject(L"LDAP:", IID_IADsUser, (void**) &pObject); if (SUCCEEDED(hr)) { hr = pObject->OpenDSObject(L"LDAP://net.blum",UserName, Code, ADS_SECURE_AUTHENTICATION, &pDisp); pObject->Release(); if (SUCCEEDED(hr)) { RetValue = true; } } pDisp = NULL; pObject = NULL; return RetValue; }
when i compile the code, the compiler says: WinLogon.obj : error LNK2001: unresolved external symbol _IID_IADsUser Any ideas how to solve this problem ? I've checked the platform SDK samples.. all are using this IID.. but i haven't seen a single include or lib file they were linking..
"I'm from the South Bronx, and I don't care what you say: those cows look dangerous."
U.S. Secretary of State Colin Powell at George Bush's ranch in TexasHi, use "__uuidof ( expression )", where "expression" is interface name ie "IADsUser". The chosen One :)
-
guess you forgot to use the <> - Tags.. so your include got stripped..
"I'm from the South Bronx, and I don't care what you say: those cows look dangerous."
U.S. Secretary of State Colin Powell at George Bush's ranch in Texas#include <activeds.h>
is there, you just have to look real close! ;)
Five birds are sitting on a fence. Three of them decide to fly off. How many are left?