LDAP programming oddity; MS Issue or Borland Issue?

LDAP programming oddity; MS Issue or Borland Issue?

Post by Joe Richards [MVP » Thu, 07 Feb 2002 20:16:20



OS: W2K Pro SP2
Compiler: BCB5 Pro with all one patches. :o)

When setting options for LDAP programming you are supposed to set LDAP
Options like so

uErr=ldap_set_option(pLdap, LDAP_OPT_AREC_EXCLUSIVE, LDAP_OPT_ON);

or

uErr=ldap_set_option(pLdap, LDAP_OPT_AREC_EXCLUSIVE, LDAP_OPT_OFF);

Where LDAP_OPT_ON/OFF are defined in winldap.h as

#define LDAP_OPT_ON                 ((void *) 1)
#define LDAP_OPT_OFF                ((void *) 0)

However setting options this way comes back with LDAP Error 0x59 which is
Invalid parameter.

---

Coding the option setting in the following manner does work:

LdapOpt=1; // LDAP_OPT_ON
uErr=ldap_set_option(pLdap, LDAP_OPT_AREC_EXCLUSIVE, (void*) &LdapOpt);

---

I am guessing because when using LDAP_OPT_ON it is taking it as a pointer
specifying the address 1 versus a pointer to the address holding the value
1. Am I thinking correctly?

If that is correct this seems pretty strange as this definition of
LDAP_OPT_ON/OFF seems pretty standard. It is in the Microsoft and iPlanet
SDK's that way and is what is shipped with Builder. It would seem if this
was an error that people would have hit against this pretty extensively and
it would be corrected.

 joe

--
Joe Richards
www.joeware.net
---

 
 
 

1. LDAP programming oddity; MS Issue or Borland Issue?

OS: W2K Pro
Compiler: BCB5 Pro with all one patches. :o)

When setting options for LDAP programming you are supposed to set LDAP
Options like so

uErr=ldap_set_option(pLdap, LDAP_OPT_AREC_EXCLUSIVE, LDAP_OPT_ON);

or

uErr=ldap_set_option(pLdap, LDAP_OPT_AREC_EXCLUSIVE, LDAP_OPT_OFF);

Where LDAP_OPT_ON/OFF are defined in winldap.h as

#define LDAP_OPT_ON                 ((void *) 1)
#define LDAP_OPT_OFF                ((void *) 0)

However setting options this way comes back with LDAP Error 0x59 which is
Invalid parameter.

---

Coding the option setting in the following manner does work:

LdapOpt=1; // LDAP_OPT_ON
uErr=ldap_set_option(pLdap, LDAP_OPT_AREC_EXCLUSIVE, (void*) &LdapOpt);

---

I am guessing because when using LDAP_OPT_ON it is taking it as a pointer
specifying the address 1 versus a pointer to the address holding the value
1. Am I thinking correctly?

If that is correct this seems pretty strange as this definition of
LDAP_OPT_ON/OFF seems pretty standard. It is in the Microsoft and iPlanet
SDK's that way and is what is shipped with Builder. It would seem if this
was an error that people would have hit against this pretty extensively and
it would be corrected.

 joe

--
Joe Richards
www.joeware.net
---

2. WTB: Amiga 3000 Tower

3. Issuing a DOS command from a Windows Borland C++ program

4. Anyone using New 3Com's DMT ADSL Modem?

5. Issuing a DOS command from a Borland C++ Windows program

6. Unit Testing-Industry Standards

7. Vista development issues - general issues/questions

8. Is this an efficiency issue or a stylistic issue?

9. Issue #75 of Rev. 16 Standard C++ Library Issues List

10. Urgent! New release MS Codec Pack Issue

11. Where ti find New TAPI Samples and DLL Updates in November Issue of MS Platform SDK

12. portability of C++ exceptions (MS Windows issues)