Forum |  HardWare.fr | News | Articles | PC | S'identifier | S'inscrire | Shop Recherche
1694 connectés 

  FORUM HardWare.fr
  Programmation
  C++

  LDAP

 


 Mot :   Pseudo :  
 
Bas de page
Auteur Sujet :

LDAP

n°2300791
Dolb66
Posté le 17-05-2017 à 13:34:32  profilanswer
 

Bonjour,
 
Je cherche à dérouler la liste des utilisateurs du LDAP de l'entreprise où j'effectue mon stage,
J'ai trouver un code source pas mal partagé sur internet, partagé par Microsoft :
 

Code :
  1. //  Add msvcrt.dll to the project.
  2. //  Add activeds.lib to the project.
  3. #include "stdafx.h"
  4. #include <objbase.h>
  5. #include <wchar.h>
  6. #include <activeds.h>
  7. //  Define UNICODE.
  8. //  Define version 5 for Windows 2000.
  9. #define _WIN32_WINNT 0x0500
  10. #include <sddl.h>
  11. HRESULT FindUsers(IDirectorySearch *pContainerToSearch,  //  IDirectorySearch pointer to the container to search.
  12.     LPOLESTR szFilter, //  Filter to find specific users.
  13.     //  NULL returns all user objects.
  14.     LPOLESTR *pszPropertiesToReturn, //  Properties to return for user objects found.
  15.     //  NULL returns all set properties.
  16.     BOOL bIsVerbose //  TRUE indicates that display all properties for the found objects.
  17.     //  FALSE indicates that only the RDN.
  18.     );
  19. //  Entry point for the application.
  20. void wmain(int argc, wchar_t *argv[ ])
  21. {
  22. #ifdef _MBCS
  23.     //  Handle the command line arguments.
  24.     DWORD dwLength = MAX_PATH*2;
  25.     LPOLESTR pszBuffer = new OLECHAR[dwLength];
  26.     wcsncpy_s(pszBuffer, L"",dwLength);
  27.     BOOL bReturnVerbose = FALSE;
  28.     for (int i = 1;i<argc;i++)
  29.     {
  30.         if (_wcsicmp(argv[i],L"/V" ) == 0)
  31.         {
  32.             bReturnVerbose = TRUE;
  33.         }
  34.         else if ((_wcsicmp(argv[i],L"/?" ) == 0)||
  35.             (_wcsicmp(argv[i],L"-?" ) == 0))
  36.         {
  37.             wprintf(L"This application queries for users in the current user domain.\n" );
  38.             wprintf(L"Syntax: queryusers [/V][querystring]\n" );
  39.             wprintf(L"where /V specifies that all properties for the found users should be returned.\n" );
  40.             wprintf(L"querystring is the query criteria in ldap query format.\n" );
  41.             wprintf(L"Defaults: If no /V is specified, the query returns only the RDN and DN of the items found.\n" );
  42.             wprintf(L"If no querystring is specified, the query returns all users.\n" );
  43.             wprintf(L"Example: queryusers (sn=Smith)\n" );
  44.             wprintf(L"Returns all users with surname Smith.\n" );
  45.             return;
  46.         }
  47.         else
  48.         {
  49.             wcsncpy_s(pszBuffer,argv[i],dwLength-wcslen(pszBuffer));
  50.         }
  51.     }
  52.     if (_wcsicmp(pszBuffer,L"" ) == 0)
  53.         wprintf(L"\nFinding all user objects...\n\n" );
  54.     else
  55.         wprintf(L"\nFinding user objects based on query: %s...\n\n", pszBuffer);
  56.     //  Initialize COM.
  57.     CoInitialize(NULL);
  58.     HRESULT hr = S_OK;
  59.     //  Get rootDSE and the current user domain container distinguished name.
  60.     IADs *pObject = NULL;
  61.     IDirectorySearch *pContainerToSearch = NULL;
  62.     LPOLESTR szPath = new OLECHAR[MAX_PATH];
  63.     VARIANT var;
  64.     hr = ADsOpenObject(L"LDAP://rootDSE",
  65.                        NULL,
  66.                        NULL,
  67.                        ADS_SECURE_AUTHENTICATION, // Use Secure Authentication.
  68.                        IID_IADs,
  69.                        (void**)&pObject);
  70.     if (FAILED(hr))
  71.     {
  72.         wprintf(L"Cannot execute query. Cannot bind to LDAP://rootDSE.\n" );
  73.         if (pObject)
  74.             pObject->Release();
  75.         return;
  76.     }
  77.     if (SUCCEEDED(hr))
  78.     {
  79.         hr = pObject->Get(_bstr_t("defaultNamingContext" ),&var);
  80.         if (SUCCEEDED(hr))
  81.         {
  82.             //  Build path to the domain container.
  83.             wcsncpy_s(szPath,L"LDAP://",MAX_PATH);
  84.             wcsncat_s(szPath,var.bstrVal,MAX_PATH-wcslen(szPath));
  85.             hr = ADsOpenObject(szPath,
  86.                                NULL,
  87.                                NULL,
  88.                                ADS_SECURE_AUTHENTICATION, //  Use Secure Authentication.
  89.                                IID_IDirectorySearch,
  90.                                (void**)&pContainerToSearch);
  91.             if (SUCCEEDED(hr))
  92.             {
  93.                 hr = FindUsers(pContainerToSearch, //  IDirectorySearch pointer to domainDNS container.
  94.                                pszBuffer, 
  95.                                NULL, //  Return all properties.
  96.                                bReturnVerbose
  97.                              );
  98.                 if (SUCCEEDED(hr))
  99.                 {
  100.                     if (S_FALSE==hr)
  101.                         wprintf(L"User object cannot be found.\n" );
  102.                 }
  103.                 else if (E_ADS_INVALID_FILTER==hr)
  104.                     wprintf(L"Cannot execute query. Invalid filter was specified.\n" );
  105.                 else
  106.                     wprintf(L"Query failed to run. HRESULT: %x\n",hr);
  107.             }
  108.             else
  109.             {
  110.                 wprintf(L"Cannot execute query. Cannot bind to the container.\n" );
  111.             }
  112.             if (pContainerToSearch)
  113.                 pContainerToSearch->Release();
  114.         }
  115.         VariantClear(&var);
  116.     }
  117.     if (pObject)
  118.         pObject->Release();
  119.     //  Uninitialize COM.
  120.     CoUninitialize();
  121.     delete [] szPath;
  122.     delete [] pszBuffer;
  123.     return;
  124. #endif _MBCS
  125. }
  126. HRESULT FindUsers(IDirectorySearch *pContainerToSearch,  //  IDirectorySearch pointer to the container to search.
  127.     LPOLESTR szFilter, //  Filter for finding specific users.
  128.     //  NULL returns all user objects.
  129.     LPOLESTR *pszPropertiesToReturn, //  Properties to return for user objects found.
  130.     //  NULL returns all set properties.
  131.     BOOL bIsVerbose    //  TRUE indicates that all properties for the found objects are displayed.
  132.     //  FALSE indicates only the RDN.
  133.     )
  134. {
  135.     if (!pContainerToSearch)
  136.         return E_POINTER;
  137.     DWORD dwLength = MAX_PATH*2;
  138.     // Create search filter.
  139.     LPOLESTR pszSearchFilter = new OLECHAR[dwLength];
  140.     //  Add the filter.
  141.     swprintf_s(pszSearchFilter, dwLength, L"(&(objectClass=user)(objectCategory=person)%s)",szFilter);
  142.     //  Specify subtree search.
  143.     ADS_SEARCHPREF_INFO SearchPrefs;
  144.     SearchPrefs.dwSearchPref = ADS_SEARCHPREF_SEARCH_SCOPE;
  145.     SearchPrefs.vValue.dwType = ADSTYPE_INTEGER;
  146.     SearchPrefs.vValue.Integer = ADS_SCOPE_SUBTREE;
  147.     DWORD dwNumPrefs = 1;
  148.     //  COL for iterations.
  149.     LPOLESTR pszColumn = NULL; 
  150.     ADS_SEARCH_COLUMN col;
  151.     HRESULT hr = S_OK;
  152.     //  Interface Pointers
  153.     IADs  *pObj = NULL;
  154.     IADs  * pIADs = NULL;
  155.     //  Search handle.
  156.     ADS_SEARCH_HANDLE hSearch = NULL;
  157.     //  Set search preference.
  158.     hr = pContainerToSearch->SetSearchPreference(&SearchPrefs, dwNumPrefs);
  159.     if (FAILED(hr))
  160.         return hr;
  161.     LPOLESTR pszBool = NULL;
  162.     DWORD dwBool = 0;
  163.     PSID pObjectSID = NULL;
  164.     LPOLESTR szSID = NULL;
  165.     LPOLESTR szDSGUID = new WCHAR [39];
  166.     LPGUID pObjectGUID = NULL;
  167.     FILETIME filetime;
  168.     SYSTEMTIME systemtime;
  169.     DATE date;
  170.     VARIANT varDate;
  171.     LARGE_INTEGER liValue;
  172.     LPOLESTR *pszPropertyList = NULL;
  173.     LPOLESTR pszNonVerboseList[] = {L"name",L"distinguishedName"};
  174.     LPOLESTR szName = new OLECHAR[MAX_PATH];
  175.     LPOLESTR szDN = new OLECHAR[MAX_PATH];
  176.     VariantInit(&varDate);
  177.     int iCount = 0;
  178.     DWORD x = 0L;
  179.     if (!bIsVerbose)
  180.     {
  181.         //  Return non-verbose list properties only.
  182.         hr = pContainerToSearch->ExecuteSearch(pszSearchFilter,
  183.                                                pszNonVerboseList,
  184.                                                sizeof(pszNonVerboseList)/sizeof(LPOLESTR),
  185.                                                &hSearch
  186.                                              );
  187.     }
  188.     else
  189.     {
  190.         if (!pszPropertiesToReturn)
  191.         {
  192.             //  Return all properties.
  193.             hr = pContainerToSearch->ExecuteSearch(pszSearchFilter,
  194.                                                    NULL,
  195.                                                    (DWORD)-1,
  196.                                                    &hSearch
  197.                                                  );
  198.         }
  199.         else
  200.         {
  201.             //  Specified subset.
  202.             pszPropertyList = pszPropertiesToReturn;
  203.             //  Return specified properties.
  204.             hr = pContainerToSearch->ExecuteSearch(pszSearchFilter,
  205.                                                    pszPropertyList,
  206.                                                    sizeof(pszPropertyList)/sizeof(LPOLESTR),
  207.                                                    &hSearch
  208.                                                  );
  209.         }
  210.     }
  211.     if (SUCCEEDED(hr))
  212.     { 
  213.         //  Call IDirectorySearch::GetNextRow() to retrieve the next data row.
  214.         hr = pContainerToSearch->GetFirstRow(hSearch);
  215.         if (SUCCEEDED(hr))
  216.         {
  217.             while(hr != S_ADS_NOMORE_ROWS)
  218.             {
  219.                 //  Keep track of count.
  220.                 iCount++;
  221.                 if (bIsVerbose)
  222.                     wprintf(L"----------------------------------\n" );
  223.                 //  Loop through the array of passed column names,
  224.                 //  print the data for each column.
  225.                 while(pContainerToSearch->GetNextColumnName(hSearch, &pszColumn) != S_ADS_NOMORE_COLUMNS)
  226.                 {
  227.                     hr = pContainerToSearch->GetColumn(hSearch, pszColumn, &col);
  228.                     if (SUCCEEDED(hr))
  229.                     {
  230.                         //  Print the data for the column and free the column.
  231.                         if(bIsVerbose)
  232.                         {
  233.                             //  Get the data for this column.
  234.                             wprintf(L"%s\n",col.pszAttrName);
  235.                             switch (col.dwADsType)
  236.                             {
  237.                             case ADSTYPE_DN_STRING:
  238.                                 for (x = 0; x< col.dwNumValues; x++)
  239.                                 {
  240.                                     wprintf(L"  %s\r\n",col.pADsValues[x].DNString);
  241.                                 }
  242.                                 break;
  243.                             case ADSTYPE_CASE_EXACT_STRING:   
  244.                             case ADSTYPE_CASE_IGNORE_STRING:   
  245.                             case ADSTYPE_PRINTABLE_STRING:   
  246.                             case ADSTYPE_NUMERIC_STRING:     
  247.                             case ADSTYPE_TYPEDNAME:       
  248.                             case ADSTYPE_FAXNUMBER:       
  249.                             case ADSTYPE_PATH:         
  250.                                 for (x = 0; x< col.dwNumValues; x++)
  251.                                 {
  252.                                     wprintf(L"  %s\r\n",col.pADsValues[x].CaseIgnoreString);
  253.                                 }
  254.                                 break;
  255.                             case ADSTYPE_BOOLEAN:
  256.                                 for (x = 0; x< col.dwNumValues; x++)
  257.                                 {
  258.                                     dwBool = col.pADsValues[x].Boolean;
  259.                                     pszBool = dwBool ? L"TRUE" : L"FALSE";
  260.                                     wprintf(L"  %s\r\n",pszBool);
  261.                                 }
  262.                                 break;
  263.                             case ADSTYPE_INTEGER:
  264.                                 for (x = 0; x< col.dwNumValues; x++)
  265.                                 {
  266.                                     wprintf(L"  %d\r\n",col.pADsValues[x].Integer);
  267.                                 }
  268.                                 break;
  269.                             case ADSTYPE_OCTET_STRING:
  270.                                 if (_wcsicmp(col.pszAttrName,L"objectSID" ) == 0)
  271.                                 {
  272.                                     for (x = 0; x< col.dwNumValues; x++)
  273.                                     {
  274.                                         pObjectSID = (PSID)(col.pADsValues[x].OctetString.lpValue);
  275.                                         //  Convert SID to string.
  276.                                         ConvertSidToStringSid(pObjectSID, &szSID);
  277.                                         wprintf(L"  %s\r\n",szSID);
  278.                                         LocalFree(szSID);
  279.                                     }
  280.                                 }
  281.                                 else if ((_wcsicmp(col.pszAttrName,L"objectGUID" ) == 0))
  282.                                 {
  283.                                     for (x = 0; x< col.dwNumValues; x++)
  284.                                     {
  285.                                         //  Cast to LPGUID.
  286.                                         pObjectGUID = (LPGUID)(col.pADsValues[x].OctetString.lpValue);
  287.                                         //  Convert GUID to string.
  288.                                         ::StringFromGUID2(*pObjectGUID, szDSGUID, 39);
  289.                                         //  Print the GUID.
  290.                                         wprintf(L"  %s\r\n",szDSGUID);
  291.                                     }
  292.                                 }
  293.                                 else
  294.                                     wprintf(L"  Value of type Octet String. No Conversion." );
  295.                                 break;
  296.                             case ADSTYPE_UTC_TIME:
  297.                                 for (x = 0; x< col.dwNumValues; x++)
  298.                                 {
  299.                                     systemtime = col.pADsValues[x].UTCTime;
  300.                                     if (SystemTimeToVariantTime(&systemtime,
  301.                                         &date) != 0)
  302.                                     {
  303.                                         //  Pack in variant.vt.
  304.                                         varDate.vt = VT_DATE;
  305.                                         varDate.date = date;
  306.                                         VariantChangeType(&varDate,&varDate,VARIANT_NOVALUEPROP,VT_BSTR);
  307.                                         wprintf(L"  %s\r\n",varDate.bstrVal);
  308.                                         VariantClear(&varDate);
  309.                                     }
  310.                                     else
  311.                                         wprintf(L"  Could not convert UTC-Time.\n",pszColumn);
  312.                                 }
  313.                                 break;
  314.                             case ADSTYPE_LARGE_INTEGER:
  315.                                 for (x = 0; x< col.dwNumValues; x++)
  316.                                 {
  317.                                     liValue = col.pADsValues[x].LargeInteger;
  318.                                     filetime.dwLowDateTime = liValue.LowPart;
  319.                                     filetime.dwHighDateTime = liValue.HighPart;
  320.                                     if((filetime.dwHighDateTime==0) && (filetime.dwLowDateTime==0))
  321.                                     {
  322.                                         wprintf(L"  No value set.\n" );
  323.                                     }
  324.                                     else
  325.                                     {
  326.                                         //  Verify properties of type LargeInteger that represent time.
  327.                                         //  If TRUE, then convert to variant time.
  328.                                         if ((0==wcscmp(L"accountExpires", col.pszAttrName))|
  329.                                             (0==wcscmp(L"badPasswordTime", col.pszAttrName))||
  330.                                             (0==wcscmp(L"lastLogon", col.pszAttrName))||
  331.                                             (0==wcscmp(L"lastLogoff", col.pszAttrName))||
  332.                                             (0==wcscmp(L"lockoutTime", col.pszAttrName))||
  333.                                             (0==wcscmp(L"pwdLastSet", col.pszAttrName))
  334.                                             )
  335.                                         {
  336.                                             //  Handle special case for Never Expires where low part is -1.
  337.                                             if (filetime.dwLowDateTime==-1)
  338.                                             {
  339.                                                 wprintf(L"  Never Expires.\n" );
  340.                                             }
  341.                                             else
  342.                                             {
  343.                                                 if (FileTimeToLocalFileTime(&filetime, &filetime) != 0)
  344.                                                 {
  345.                                                     if (FileTimeToSystemTime(&filetime,
  346.                                                         &systemtime) != 0)
  347.                                                     {
  348.                                                         if (SystemTimeToVariantTime(&systemtime,
  349.                                                             &date) != 0)
  350.                                                         {
  351.                                                             //  Pack in variant.vt.
  352.                                                             varDate.vt = VT_DATE;
  353.                                                             varDate.date = date;
  354.                                                             VariantChangeType(&varDate,&varDate,VARIANT_NOVALUEPROP,VT_BSTR);
  355.                                                             wprintf(L"  %s\r\n",varDate.bstrVal);
  356.                                                             VariantClear(&varDate);
  357.                                                         }
  358.                                                         else
  359.                                                         {
  360.                                                             wprintf(L"  FileTimeToVariantTime failed\n" );
  361.                                                         }
  362.                                                     }
  363.                                                     else
  364.                                                     {
  365.                                                         wprintf(L"  FileTimeToSystemTime failed\n" );
  366.                                                     }
  367.                                                 }
  368.                                                 else
  369.                                                 {
  370.                                                     wprintf(L"  FileTimeToLocalFileTime failed\n" );
  371.                                                 }
  372.                                             }
  373.                                         }
  374.                                         else
  375.                                         {
  376.                                             //  Print the LargeInteger.
  377.                                             wprintf(L"  high: %d low: %d\r\n",filetime.dwHighDateTime, filetime.dwLowDateTime);
  378.                                         }
  379.                                     }
  380.                                 }
  381.                                 break;
  382.                             case ADSTYPE_NT_SECURITY_DESCRIPTOR:
  383.                                 for (x = 0; x< col.dwNumValues; x++)
  384.                                 {
  385.                                     wprintf(L"  Security descriptor.\n" );
  386.                                 }
  387.                                 break;
  388.                             default:
  389.                                 wprintf(L"Unknown type %d.\n",col.dwADsType);
  390.                             }
  391.                         }
  392.                         else
  393.                         {
  394. #ifdef _MBCS
  395.                             //  Verbose handles only the two single-valued attributes: cn and ldapdisplayname,
  396.                             //  so this is a special case.
  397.                             if (0==wcscmp(L"name", pszColumn))
  398.                             {
  399.                                 wcscpy_s(szName,col.pADsValues->CaseIgnoreString);
  400.                             }
  401.                             if (0==wcscmp(L"distinguishedName", pszColumn))
  402.                             {
  403.                                 wcscpy_s(szDN,col.pADsValues->CaseIgnoreString);
  404.                             }
  405. #endif _MBCS
  406.                         }
  407.                         pContainerToSearch->FreeColumn(&col);
  408.                     }
  409.                     FreeADsMem(pszColumn);
  410.                 }
  411.                 if (!bIsVerbose)
  412.                     wprintf(L"%s\n  DN: %s\n\n",szName,szDN);
  413.                 //  Get the next row.
  414.                 hr = pContainerToSearch->GetNextRow(hSearch);
  415.             }
  416.         }
  417.         //  Close the search handle to cleanup.
  418.         pContainerToSearch->CloseSearchHandle(hSearch);
  419.     }
  420.     if (SUCCEEDED(hr) && 0==iCount)
  421.         hr = S_FALSE;
  422.     delete [] szName;
  423.     delete [] szDN;
  424.     delete [] szDSGUID;
  425.     delete [] pszSearchFilter;
  426.     return hr;
  427. }


 
 
J'admet être une quiche en reseau donc je comprends pas comment la connexion se déroule, il faut que j'indique le serveur DNS ou pas?
Quand j'execute ce code sa me renvoie deux erreurs  LNK2019 et LNK1120 erreur externe non résolu.
 
J'ai compris qu'a un moment il reçoit l'AD et que selon le type de donné qu'il reçoit, grâce aux Switch chaque "type" de donné sera traité différemment.
 
Cependant je ne comprends pas d'où viennent les erreurs mise à part un probleme sur une connexion
 
Si quelqu'un peut m'aider merci   :hello:

mood
Publicité
Posté le 17-05-2017 à 13:34:32  profilanswer
 

n°2300796
rat de com​bat
attention rongeur méchant!
Posté le 17-05-2017 à 14:05:29  profilanswer
 

>Quand j'execute ce code sa me renvoie deux erreurs  LNK2019 et LNK1120 erreur externe non résolu.  
Quand tu exécutes ce que produit le compilateur ou quand tu compiles? Si 2) regarde les commentaires ligne 1+2, faut bien configurer ton compilateur. Profite-en pour activer les warnings!

n°2300802
Dolb66
Posté le 17-05-2017 à 14:54:28  profilanswer
 

Bonjour, mes warnings sont déjà activé, cependant c'est bien quand j’exécute le code que sa plante, lorsque je compile, je n'ai aucune erreurs ni avertissement

n°2300810
rat de com​bat
attention rongeur méchant!
Posté le 17-05-2017 à 17:23:01  profilanswer
 

Dolb66 a écrit :

lorsque je compile, je n'ai aucune erreurs ni avertissement

Ca c'est très étrange. D'après MSDN LNK2019 et LNK1120 sont des erreurs du linker (un peu évident vu le "LNK"...) et donc quelque chose qui se produit au moment de compiler... Quel est le comportement exact quand tu exécutes (avec un double-clic sur un fichier .exe on est bien d'accord?), tu vois un message d'erreur dans un dialogue genre ceci? Est-ce que msvcrt.dll existe quelque part sur ton système et si oui où? Qu'en est-il de activeds.lib?
 
MSDN (pour Visual Studio 2015 mais ça n'a pas dû changer):
https://msdn.microsoft.com/en-us/library/799kze2z.aspx
https://msdn.microsoft.com/en-us/library/z98k84c3.aspx

n°2300819
gilou
Modérateur
Modzilla
Posté le 17-05-2017 à 22:37:00  profilanswer
 

> D'après MSDN LNK2019 et LNK1120 sont des erreurs du linker (un peu évident vu le "LNK"...) et donc quelque chose qui se produit au moment de compiler...  
Ou bien peut être une résolution de liens dynamiques échoue a l'exécution.
A+,


---------------
There's more than what can be linked! --    Iyashikei Anime Forever!    --  AngularJS c'est un framework d'engulé!  --
n°2300823
rat de com​bat
attention rongeur méchant!
Posté le 17-05-2017 à 23:21:17  profilanswer
 

>Ou bien peut être une résolution de liens dynamiques échoue a l'exécution.  
J'y avais pensé, d'où ma question à quoi ressemble le message d'erreur. Mais pour moi Linker==compilation, au moment de l'exécution c'est plutôt un Loader non? :o

n°2300832
Dolb66
Posté le 18-05-2017 à 09:54:30  profilanswer
 

Probable que cela vienne du dll et .lib,
A quel emplacement doivent-ils être posés précisement?
 
Dans mon dossier Visual Studio ou dans le dossier du projet? (j'ai effectué le second choix)
 
Cdlt

n°2300844
rat de com​bat
attention rongeur méchant!
Posté le 18-05-2017 à 14:15:38  profilanswer
 

Tu n'as pas répondu à ma question.

Citation :

Quel est le comportement exact quand tu exécutes (avec un double-clic sur un fichier .exe on est bien d'accord?), tu vois un message d'erreur dans un dialogue genre ceci?


 
La dll là où se trouve l'exécutable, la lib peu importe tant que tu indiques l'endroit au linker/compilateur.

n°2300847
Dolb66
Posté le 18-05-2017 à 15:02:28  profilanswer
 

Le .exe est completement absent du dossier vu qu'il n'a jamais fonctionner sur visual, je l execute directemet sur le logiciel :  "Symbole externe non résolu _FreeADsMem@4 référencé dans la fonction "long_cdecl FindUsers...  Je pense que je vais changer de langage pour ce programme, Merci

n°2300854
rat de com​bat
attention rongeur méchant!
Posté le 18-05-2017 à 15:54:35  profilanswer
 

J'avais donc raison: Erreur de Linker au moment de compiler. Faut configurer ton Visual Studio pour lui dire où se trouve la lib, autrement dit RTFM. ;)


Message édité par rat de combat le 18-05-2017 à 15:54:47
mood
Publicité
Posté le 18-05-2017 à 15:54:35  profilanswer
 

n°2300860
xilebo
noone
Posté le 18-05-2017 à 16:53:08  profilanswer
 

cf  : https://msdn.microsoft.com/en-us/li [...] s.85).aspx
 
Dans ton projet visual ( bouton droit propriétés sur le projet ) , il faut que tu ajoutes Activeds.lib dans Editeur de liens -> Entrée -> dépendances supplémentaires.  
 
Comme il s'agit d'une bibliothèque système, normalement pas besoin de préciser le path , sinon c'est dans Editeur de liens -> Général -> Répertoires de bibliothèques supplémentaires
 
Attention de choisir la bonne configuration et la bonne plateforme ( il faut le faire pour chaque , Debug / Release , win32 / x64  , etc... )

n°2300892
Dolb66
Posté le 19-05-2017 à 09:21:08  profilanswer
 

Merci beaucoup sa s'execute (y)

n°2300993
rat de com​bat
attention rongeur méchant!
Posté le 20-05-2017 à 19:18:08  profilanswer
 

Dolb66 a écrit :

Merci beaucoup sa s'execute (y)

Certes, mais surtout avant ça compile. Comme je viens de le dire dans un autre sujet, il est très important d'utiliser les bons termes (dés le début quand on apprend encore histoire de ne pas créer de mauvaises habitudes) pour éviter les malentendus comme dans ce sujet!


Aller à :
Ajouter une réponse
  FORUM HardWare.fr
  Programmation
  C++

  LDAP

 

Sujets relatifs
LDAP TO SQLLdap et php blocage de session
[PHP] SSO avec LDAPIntégration ldap sur sql serveur
se connecter à l' annuaire ldap avec phpldapadminAPI Ldap
Vérification du password (LDAP)ldap recherche dans les répertoires
Authentification LDAP[WebDev15] GUID Ldap ou comment récupérer de l'hexadecimale..
Plus de sujets relatifs à : LDAP


Copyright © 1997-2022 Hardware.fr SARL (Signaler un contenu illicite / Données personnelles) / Groupe LDLC / Shop HFR