Hello, All.
I am being driven out of my mind trying to convert a tiny little C program using an off-the-shelf network DLL into PB.
As far as I can tell, the only substantive difference that remains is the use of an opaque structure in C as a return value for a DLL initialization function. This opaque structure is then passed to a follow-up function like so:
int hr, port;
char *host, *login, *password;
LDAP *ld;
if (( ld = init( host, port )) != NULL)
{
hr = bind( ld, login, password );
}
Where LDAP is officially referred to in the DLL docs as an opaque structure and thus is not really "defined."
So, vaguely understanding its purpose in C but knowing that there is nothing by that name in PB, I have tried it as a DWORD PTR, LONG PTR, DWORD, and LONG, all to no success:
LOCAL host AS STRING, login AS STRING, password AS STRING
LOCAL port AS LONG, hr AS LONG
LOCAL LDAP AS (various options)
ldap = init(host,port)
hr = bind(ldap,login,password)
The MOST annoying thing--and maybe this means there's a bug elsewhere in the DLL?--is that according to a network trace, my PB routine is actually sending and receiving the same decoded requests/responses as the C routine! The one thing that appears to differ is that PB never gets the SUCCESS value of 0 returned to hr, so it acts as if the call to bind() fails. Instead, I get hr as -1 or 1, depending on the datatype used for the struct.
Anybody have an idea on this?
Thanks in advance,
Sam
------------------
I am being driven out of my mind trying to convert a tiny little C program using an off-the-shelf network DLL into PB.
As far as I can tell, the only substantive difference that remains is the use of an opaque structure in C as a return value for a DLL initialization function. This opaque structure is then passed to a follow-up function like so:
int hr, port;
char *host, *login, *password;
LDAP *ld;
if (( ld = init( host, port )) != NULL)
{
hr = bind( ld, login, password );
}
Where LDAP is officially referred to in the DLL docs as an opaque structure and thus is not really "defined."
So, vaguely understanding its purpose in C but knowing that there is nothing by that name in PB, I have tried it as a DWORD PTR, LONG PTR, DWORD, and LONG, all to no success:
LOCAL host AS STRING, login AS STRING, password AS STRING
LOCAL port AS LONG, hr AS LONG
LOCAL LDAP AS (various options)
ldap = init(host,port)
hr = bind(ldap,login,password)
The MOST annoying thing--and maybe this means there's a bug elsewhere in the DLL?--is that according to a network trace, my PB routine is actually sending and receiving the same decoded requests/responses as the C routine! The one thing that appears to differ is that PB never gets the SUCCESS value of 0 returned to hr, so it acts as if the call to bind() fails. Instead, I get hr as -1 or 1, depending on the datatype used for the struct.
Anybody have an idea on this?
Thanks in advance,
Sam
------------------
Comment