Help needed with LDAP structure inside procedure
Posted: Tue Mar 01, 2016 2:15 pm
Hi,
I'm currently working with the Windows LDAP library wldap32, and it looks promising so far.
(I'll post my results as soon as i'm ready)
I have a question though.
If i write my code without procedures everything works fine but if i try to separate the elements inside procedures it crashes.
For example, this works:
but this doesn't:
Do you know what i'm doing wrong!
Thanks for the help
TeddyLM
I'm currently working with the Windows LDAP library wldap32, and it looks promising so far.
(I'll post my results as soon as i'm ready)
I have a question though.
If i write my code without procedures everything works fine but if i try to separate the elements inside procedures it crashes.
For example, this works:
Code: Select all
Prototype.i Proto_ldap_init(Domain$, PortNumber.l)
LibNr.i = OpenLibrary(#PB_Any, "wldap32.dll")
If LibNr
CompilerSelect #PB_Compiler_Unicode
CompilerCase 0
LdapInit.Proto_ldap_init = GetFunction(LibNr, "ldap_initA")
CompilerCase 1
LdapInit.Proto_ldap_init = GetFunction(LibNr, "ldap_initW")
CompilerEndSelect
Else
MessageRequester("Error", "Unable to open the LDAP library", 16) : End
EndIf
*ld = LdapInit("MyDomain", 389)
Debug *ld
Code: Select all
Prototype.i Proto_ldap_init(Domain$, PortNumber.l)
LibNr.i = OpenLibrary(#PB_Any, "wldap32.dll")
If LibNr
CompilerSelect #PB_Compiler_Unicode
CompilerCase 0
Global LdapInit.Proto_ldap_init = GetFunction(LibNr, "ldap_initA")
CompilerCase 1
Global LdapInit.Proto_ldap_init = GetFunction(LibNr, "ldap_initW")
CompilerEndSelect
Else
MessageRequester("Error", "Unable to open the LDAP library", 16) : End
EndIf
Procedure.i LDAP_INIT(Domainname$, PortNumber.l)
*ld = LdapInit(Domainname$, PortNumber.l)
ProcedureReturn *ld
EndProcedure
Debug LDAP_INIT("MyDomain", 389)
Thanks for the help
TeddyLM