November 26th, 2009, 05:08 AM
Join Date: Nov 2009
Time spent in forums: 7 m 51 sec
Reputation Power: 0
I am interested in the c program that works. Could you give an example on what you have done and how you did it? I am using Borland C++Builder 6.
Originally Posted by yuefei
i've got a program to connect to a ldap server in delphi.
in fact, i've written one on C which works, just after i translated it into delphi.. i'm using CodeGear Delphi for windows and the winldap class from Luk Vermeulen.
my code is:
ld : PLDAP;
ld := ldap_init(PWideChar(sServeur), LDAP_PORT);
if ld = nil then
showMessage('ERROR: ldap_init: ' + ldap_err2stringW(GetLastError));
ldap_set_optionW(ld, LDAP_OPT_PROTOCOL_VERSION, pointer(ld.ld_version));
iRtn := ldap_connect(ld,nil);
then the error message 0x51 for ldap_connect returned:
Cannot contact the LDAP server.
but at the meantime, i've tried my code C and it works perfectly.
much thanks for your help