May 08, 2024, 08:54:31 PM

News:

IonicWind Snippit Manager 2.xx Released!  Install it on a memory stick and take it with you!  With or without IWBasic!


I can't access to functions in my dll

Started by Techno, October 29, 2008, 02:18:42 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Techno

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

Ionic Wind Support Team

Stephane,
It's a DLL, you have to use the IMPORT keyword.

Users Guide -> Language -> Using DLL's

Ionic Wind Support Team

Techno

Paul

Where can I place this import keyword in my include file?

Ionic Wind Support Team

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.
Ionic Wind Support Team