Did you try to load/unload the dll for each call?
EMG
Did you try to load/unload the dll for each call?
EMG
DLL STATIC FUNCTION I2PDF_GetDLLVersion( ) AS LONG;
FROM "I2PDF_GetDLLVersion" LIB "F:\UTILITY\IMAGE2PDF.DLL"CALLPROC := "I2PDF_MakePDF"
PARM1 := outfile // output file
PARM2 := 0 // options
PARM3 := SPACE( BUFFER_SIZE ) // CBUFFER
PARM4 := buffer_size // MAXTEXTERROR SIZE
RETURN_TYPE := LONG
CFARPROC := GetProcAdd(NDLL,CALLPROC, PASCAL_TYPE, RETURN_TYPE, ;
LPSTR, LONG, LPSTR, LONG )
RETVAL := calldll( CFARPROC, PARM1, PARM2, @PARM3, PARM4 )#include "FiveWin.ch"
function Main()
I2PDF_License( "Hello world" )
MsgInfo( "ok" )
return nil
DLL STATIC FUNCTION I2PDF_License( cLicCode AS LPSTR) AS VOID PASCAL ;
FROM "I2PDF_License" LIB "Image2PDF.dll"#include "FiveWin.ch"
static hLIB
function Main()
hLIB := LoadLibrary( "Image2PDF.dll" )
I2PDF_License( "Hello world" )
I2PDF_SetDPI( 123 )
MsgInfo( I2PDF_GetDLLVersion() )
MsgInfo( "ok" )
FreeLibrary( hLIB )
return nil
DLL STATIC FUNCTION I2PDF_License( cLicCode AS LPSTR ) AS VOID PASCAL ;
FROM "I2PDF_License" LIB hLIB
DLL STATIC FUNCTION I2PDF_SetDPI( nDpi AS LONG ) AS LONG ;
PASCAL FROM "I2PDF_SetDPI" LIB hLIB
DLL STATIC FUNCTION I2PDF_GetDLLVersion( ) AS LONG;
PASCAL FROM "I2PDF_GetDLLVersion" LIB hLibI'm also using version 252. The DLL is dated
04/11/2009 11:17 PM 1,003,520 Image2PDF.dll
I get the exact same results with an older version 240 which has worked perfectly for us in the past.
05/15/2008 10:20 PM 865,792 Image2PDF.dll
I tried your code snippet and it GPF's here. I put the debugger in the program and it behaved exactly the same as I described in a prior posting.
Can you show me the compile and link scripts you used? Maybe I'm not using correct libraries or compile switches?
Don,
I tested it using Harbour and Borland C. Used standard FWH samples buildh.bat
Are you using Harbour or xHarbour ?
I used xHarbour and Harbour with the buildx.bat and buildh.bat supplied with FiveWin
both got gpf.
here is the Harbour link script from b32.bc using Harbour 2.0 shipped with FWH
c:\borland\bcc55\lib\c0w32.obj +
dllpdf.obj, +
dllpdf.exe, +
dllpdf.map, +
...\lib\FiveH.lib ...\lib\FiveHC.lib +
t:\harb20\lib\win\bcc\hbrtl.lib +
t:\harb20\lib\win\bcc\hbvm.lib +
t:\harb20\lib\win\bcc\gtgui.lib +
t:\harb20\lib\win\bcc\hblang.lib +
t:\harb20\lib\win\bcc\hbmacro.lib +
t:\harb20\lib\win\bcc\hbrdd.lib +
t:\harb20\lib\win\bcc\rddntx.lib +
t:\harb20\lib\win\bcc\rddcdx.lib +
t:\harb20\lib\win\bcc\rddfpt.lib +
t:\harb20\lib\win\bcc\hbsix.lib +
t:\harb20\lib\win\bcc\hbdebug.lib +
t:\harb20\lib\win\bcc\hbcommon.lib +
t:\harb20\lib\win\bcc\hbpp.lib +
t:\harb20\lib\win\bcc\hbcpage.lib +
t:\harb20\lib\win\bcc\hbwin.lib +
t:\harb20\lib\win\bcc\hbcplr.lib +
c:\borland\bcc55\lib\cw32.lib +
c:\borland\bcc55\lib\uuid.lib +
c:\borland\bcc55\lib\import32.lib +
c:\borland\bcc55\lib\psdk\odbc32.lib +
c:\borland\bcc55\lib\psdk\nddeapi.lib +
c:\borland\bcc55\lib\psdk\iphlpapi.lib +
c:\borland\bcc55\lib\psdk\msimg32.lib +
c:\borland\bcc55\lib\psdk\rasapi32.lib,
dllpdf.res
here is link script using xHarbour 1.2 shipped with FWH
C:\Borland\BCC55\lib\c0w32.obj +
dllpdf.obj, +
dllpdf.exe, +
dllpdf.map, +
...\lib\Fivehx.lib ...\lib\FiveHC.lib +
T:\XHARB12\lib\rtl.lib +
T:\XHARB12\lib\vm.lib +
T:\XHARB12\lib\gtgui.lib +
T:\XHARB12\lib\lang.lib +
T:\XHARB12\lib\macro.lib +
T:\XHARB12\lib\rdd.lib +
T:\XHARB12\lib\dbfntx.lib +
T:\XHARB12\lib\dbfcdx.lib +
T:\XHARB12\lib\dbffpt.lib +
T:\XHARB12\lib\hbsix.lib +
T:\XHARB12\lib\debug.lib +
T:\XHARB12\lib\common.lib +
T:\XHARB12\lib\pp.lib +
T:\XHARB12\lib\pcrepos.lib +
C:\Borland\BCC55\lib\cw32.lib +
C:\Borland\BCC55\lib\import32.lib +
C:\Borland\BCC55\lib\uuid.lib +
C:\Borland\BCC55\lib\psdk\odbc32.lib +
C:\Borland\BCC55\lib\psdk\rasapi32.lib +
C:\Borland\BCC55\lib\psdk\nddeapi.lib +
C:\Borland\BCC55\lib\psdk\msimg32.lib +
C:\Borland\BCC55\lib\psdk\iphlpapi.lib,
dllpdf.res
Don,
Please download my test files and run them in your computer, thanks
your test.exe file works fine here.
I recompiled with my version of buildx.bat and buildh.bat and both created GPF's.
can you show me the b32.bc output you used from both the compile and link step?
Don,
c:\bcc55\lib\c0w32.obj +
C:\test.obj, +
C:\test.exe, +
C:\test.map, +
c:\fwh\lib\FiveH.lib c:\fwh\lib\FiveHC.lib +
c:\harbour\lib\hbrtl.lib +
c:\harbour\lib\hbvm.lib +
c:\harbour\lib\gtgui.lib +
c:\harbour\lib\hblang.lib +
c:\harbour\lib\hbmacro.lib +
c:\harbour\lib\hbrdd.lib +
c:\harbour\lib\rddntx.lib +
c:\harbour\lib\rddcdx.lib +
c:\harbour\lib\rddfpt.lib +
c:\harbour\lib\hbsix.lib +
c:\harbour\lib\hbdebug.lib +
c:\harbour\lib\hbcommon.lib +
c:\harbour\lib\hbpp.lib +
c:\harbour\lib\hbcpage.lib +
c:\harbour\lib\hbwin.lib +
c:\harbour\lib\hbcplr.lib +
c:\harbour\lib\hbct.lib +
c:\harbour\lib\xhb.lib +
c:\bcc55\lib\cw32.lib +
c:\bcc55\lib\uuid.lib +
c:\bcc55\lib\import32.lib +
c:\bcc55\lib\psdk\odbc32.lib +
c:\bcc55\lib\psdk\nddeapi.lib +
c:\bcc55\lib\psdk\iphlpapi.lib +
c:\bcc55\lib\psdk\msimg32.lib +
c:\bcc55\lib\psdk\rasapi32.lib,
I email you a copy of FiveH.lib and FiveHC.lib ![]()
I noticed that xHarbour also has a function named CallDLL().
Is it possible my environment is mistakenly calling the xHarbour CallDLL() version and the parm passing convention is different.
does your CallDLL and xHarbour CallDLL maybe get mixed up in my environment?
#include "FiveWin.ch"
#define DC_CALL_STD 0x0020
static hLIB
function Main()
local retval
hLIB := LoadLibrary( "Image2PDF.dll" )
retval := dllcall( hlib, DC_CALL_STD, "I2PDF_License", "Hello World" )
msginfo( retval, 'retval1-license' )
retval := dllcall( hlib, DC_CALL_STD, "I2PDF_SetDPI", 1 )
msginfo( retval, 'retval2-setdpi' )
retval := dllcall( hlib, DC_CALL_STD, "I2PDF_GetDLLVersion" )
msginfo( retval, 'retval3-version' )
FreeLibrary( hLIB )
return nilDon,
In the libs that I have sent you CallDll() has been renamed to FWCallDll() to avoid conflicts with Harbour/xHarbour.
Simply call FWCallDll() from your code or modify DLL.ch to call FWCallDll(), thanks