Problem solved(hopefully). First I had to clean up different fileversions etc from file catalog, but the main culprit I believe was an early lib filevesrion that somehow had ended in \lib catalog of freebasic . Whatever solutions I tried, the compiler chose that early(and obviously wrong version) lib version.
What I did:
Used pexports.exe on
xlcall32.dll
to create xlcall32.def
Code: Select all
[LIBRARY XLCall32.dll
EXPORTS
Excel4
Excel4v
LPenHelper
XLCallVer
Then I used dlltool.exe(shipped with FB) like this
>dlltool -k -d xlcall32.def -l libxlcall32.dll.a
Then I used Dumpbin.exe (from Microsoft VS2014) like this : Dumpbin /exports libxlcall32.dll.a
and got.
Code: Select all
File Type: LIBRARY
Exports
Ordinal Name
_Excel4
_Excel4v
_LPenHelper
_XLCallVer
Summary
..
...
test.bas
Code: Select all
#pragma once
#DEFINE __FB_WIN32__
#DEFINE __FB_LANG__
#include once "crt/long.bi"
#include once "windows.bi"
type LPXLOPER AS DWORD
#inclib "libxlcall32"
extern "Windows" 'lib "xlcall32.dll"
declare FUNCTION XLCallVer pascal ALIAS "XLCallVer"() AS LONG
end extern
extern "C" 'lib "xlcall32.dll"
DECLARE FUNCTION Excel4 ALIAS "Excel4"(byval xlfn as long, byval operRes as LPXLOPER, byval count as long, ...) as LONG
end extern
TYPE lpxloper as dword
dim lborder as long
dim xf as long,count as long
dim ffoper as LPXLOPER
lborder = XLCallVer()
print lborder
xf = 4
count = 0
lborder = Excel4(xf,ffoper,count,)
print lborder
SLEEP
END
I can also choose to omit #inclib "libxlcall32" when compiling, but need then
change code to
extern "Windows" lib "xlcall32.dll"
declare FUNCTION XLCallVer pascal ALIAS "XLCallVer"() AS LONG
end extern
extern "C" 'lib "xlcall32.dll"
DECLARE FUNCTION Excel4 ALIAS "Excel4"(byval xlfn as long, byval operRes as LPXLOPER, byval count as long, ...) as LONG
end extern
xlcall32.dll has to reside in same catalog as compiled exe
now onto more code conversions!
Thanks for help and suggestions
\E