Hi all,
When I try to compile my main they can't access to my dll library.
This is the example that I try to access this functions
I can create with success the test.dll en than the import library and give my no errors.
But when I try to compile my main program with used the functions of my dll it fails
export myfunction
export myfunction2
export INTRAND
SUB myfunction(in as INT),INT
RETURN in * 100
ENDSUB
SUB myfunction2(),INT
RETURN 0
ENDSUB
SUB INTRAND(min as INT,max as INT),INT
RETURN RAND(min,max)
ENDSUB
/* The main program */
$use "dll_test.lib"
$include "dll_test.inc"
OPENCONSOLE
DEF x AS INT : x = 500
DEF Result AS INT
Result = myfunction(x)
PRINT STR$(Result)
CLOSECONSOLE
/* Include file */
DECLARE myfunction(in as INT),INT
DECLARE myfunction2(),INT
DECLARE INTRAND(min as INT,max as INT),INT
What's is wrong because my main program fiails and have no access to my dll functions, why
What is wrong here, I'm not so an experience in EBASIC
With kind regards
Stephane
Stephane,
It's a DLL, you have to use the IMPORT keyword.
Users Guide -> Language -> Using DLL's
Paul
Where can I place this import keyword in my include file?
Please Stephane, read the users guide, at least once. I gave you the exact page you needed to look at.
DECLARE IMPORT,myfunction(in as INT),INT
DECLARE IMPORT,myfunction2(),INT
DECLARE IMPORT,INTRAND(min as INT,max as INT),INT
Paul.