Calling DLL's from Forms32
Date: 1997/04/15
Message-ID: <3353DB1D.1346_at_stibo.com>#1/1
Hi
How do I call a 32-bit windows DLL from forms ??
The DLL is defined as (Example from VB40) :
BSTR UpperCaseByRef(BSTR *pbstrOriginal) {
BSTR bstrUpperCase;
int i;
int cbOriginalLen;
LPSTR strSrcByRef, strDst;
cbOriginalLen = SysStringByteLen(*pbstrOriginal);
bstrUpperCase = SysAllocStringLen(NULL, cbOriginalLen);
strSrcByRef = (LPSTR)*pbstrOriginal; strDst = (LPSTR)bstrUpperCase;
for(i=0; i<=cbOriginalLen; i++)
*strDst++ = toupper(*strSrcByRef++);
SysReAllocString (pbstrOriginal, (BSTR)"Good Bye");
return bstrUpperCase;
}
I've tried the following:
lh_window:=ora_ffi.load_library(null,'test.dll');
fh_gpps:=ora_ffi.register_function(lh_window,'UpperCaseByRef',ora_ffi.PASCAL_STD);
ora_ffi.register_return(fh_gpps,ORA_FFI.C_CHAR_PTR); ora_ffi.register_parameter(fh_gpps,ORA_FFI.C_CHAR_PTR);
It seems that my dll is getting called, but on return it crash.
Thanks in advance
Soren M. Olesen Stibo Datagraphics Inc.Received on Tue Apr 15 1997 - 00:00:00 CEST