Welcome to the Traders Laboratory Forums.
Coding Forum Collaborate, receive help, or discuss coding related issues.

Reply
Old 01-05-2010, 12:42 AM   #1

Join Date: Jan 2010
Location: goldcoast
Posts: 5
Ignore this user

Thanks: 2
Thanked 0 Times in 0 Posts



Help Needed with Passing a Variable Name

I am new to EL and was hoping someone can direct me:

I am not sure how to pass the Variable name form EL in Multicharts to a DLL routine. I cant see any routine which gets the name.
for example if iam trying to call the following DLL from EL:

void __stdcall MyArraySort( IEasyLanguageObject* pELObj, char* MyArrayName ) // example form MC/TS SW dev kit

my easylanguage code is:

Function Code:

EXTERNAL: "example.dll", void, "MyArraySort", IEasyLanguageObject {self}, LPSTR {myArrayName};

variables: index(0);

arrays: myArray[11](0);

// fill array with some data
for index = 10 downto 1 begin myArray[index] = 10-index;end;

// call MyArraySort
MyArraySort( self, myArray);


with the above code i get the wrong argument type...

Thanks for the help
Behr
behr is offline  
Reply With Quote
Old 01-05-2010, 01:06 AM   #2

Tams's Avatar

Join Date: Sep 2008
Location: Geelong
Posts: 3,590
Ignore this user

Thanks: 2,027
Thanked 1,402 Times in 862 Posts



Re: Help Needed with Passing a Variable Name

have you read the manual?
what does it say?
__________________


..........This is a terribly difficult question to answer. The only satisfactory answer is: "It depends"...
Tams is offline  
Reply With Quote
Old 01-05-2010, 01:23 AM   #3

Join Date: Jan 2010
Location: goldcoast
Posts: 5
Ignore this user

Thanks: 2
Thanked 0 Times in 0 Posts



Re: Help Needed with Passing a Variable Name

tams

yes i have read the manual. It basicaly says to pass the variable.
obviously i am missing something as my EL code does compile. The DLL builds ok... as i have tested it with other routines...

behr
behr is offline  
Reply With Quote
Old 01-05-2010, 02:06 AM   #4

ochie's Avatar

Join Date: May 2008
Location: Lucea
Posts: 99
Ignore this user

Thanks: 32
Thanked 66 Times in 48 Posts



Re: Help Needed with Passing a Variable Name

This is the DLL Function Declaration Statement in EL.

Syntax:
DefineDLLFunc: “DLLNAME.DLL”, Return Type, “FunctionName”,
Parameters ;

Examples can be found in the EL Reference Guide in Chapter 4.
ochie is offline  
Reply With Quote
The Following User Says Thank You to ochie For This Useful Post:
behr (01-05-2010)
Old 01-05-2010, 02:43 AM   #5

Join Date: Jan 2010
Location: goldcoast
Posts: 5
Ignore this user

Thanks: 2
Thanked 0 Times in 0 Posts



Re: Help Needed with Passing a Variable Name

ochie

The EasyLanguage Extension Software Development Kit states:

The EasyLanguage analysis technique that calls the DLL function must
declare the DLL function in an external statement. This requirement
applies to the DLL only if the DLL uses the SDK. This is not a
requirement of DLL’s that do not use the SDK. If the DLL does not use
the SDK then either the external reserved word or the legacy
reserved word DefineDLLFunc may be used to declare DLL functions.

I have tried it with the DefineDLLFunc and i get the same problem.
- compile error code:: incorrect argument type

behr
behr is offline  
Reply With Quote
Old 01-05-2010, 03:18 AM   #6

ochie's Avatar

Join Date: May 2008
Location: Lucea
Posts: 99
Ignore this user

Thanks: 32
Thanked 66 Times in 48 Posts



Re: Help Needed with Passing a Variable Name

behr,

Sorry but I haven't used the SDK so not sure there. I seem to vaguely remember running into an issue using LPSTR in the past but don't remember the circumstances. Maybe you can create a simple integer add call or something just to get the interface working.

Last edited by ochie; 01-05-2010 at 03:34 AM.
ochie is offline  
Reply With Quote
Old 01-05-2010, 07:58 AM   #7

Join Date: Jan 2010
Location: goldcoast
Posts: 5
Ignore this user

Thanks: 2
Thanked 0 Times in 0 Posts



Re: Help Needed with Passing a Variable Name

ochie

I have a routine that passes a value and that works fine.... just having problem with the array that needs a variable name.

thanks

behr
behr is offline  
Reply With Quote

Reply

Tags
dll, easylanguage, variables names

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Global Variable V2.2 Tams Trading Indicators 10 02-24-2010 02:23 PM
Which Language to Use for Global Variable ? aaa Coding Forum 29 11-08-2009 04:35 AM
Variable Counter Array andypap Coding Forum 14 10-03-2009 08:23 PM
EL Strategy Help Needed Marc33139 Coding Forum 3 10-01-2009 12:21 PM
just what i needed xztheericzx Beginners Forum 0 11-04-2007 06:21 AM

All times are GMT -4. The time now is 02:12 AM.
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
CS to VB integration by DeskLancer
©2006-2011 Traders Laboratory, All Rights Reserved.