I'm using the latest beta. I have built a simple project (included) and then I have imported the custom function as follow:
--------------------------------------------------------------------------
EXTERNAL: "TestDLL.dll", float, "fl_GetXaverage", float, float, float;
Inputs: price(NumericSimple), lastp(NumericSimple), length(NumericSimple);
Vars: avg(0);
avg = fl_GetXaverage(price, lastp, length);
fGetXaverage = avg;
--------------------------------------------------------------------------
and the built the following indicator:
inputs: Price( Close ), Length( 9 );
variables: AvgExp( 0 ), p0(0), p1(0);
p0 = Price;
p1 = Price[1];
AvgExp = fGetXaverage(p0, p1, Length);
Plot1[Displace]( AvgExp, "AvgExp" ) ;
But the indicator crash ! could you help me to solve the problem ?
[Advanced Topic] EasyLanguage Extension SDK
[Advanced Topic] EasyLanguage Extension SDK
- Attachments
-
- TestSDK.zip
- (16.99 KiB) Downloaded 188 times
- Marina Pashkova
- Posts: 2758
- Joined: 27 Jul 2007
Dear danilo,Dear Marina,
We are near to release 3.0 of MC and I'd like to have an official answer to SDK support in MC. Is the EasyLanguage extension SDK supported in MC ? and if not when will be supported ?
Best Regards
Both EasyLanguage extension SDK and the SDK for TS2000i are supported in MultiCharts.
Dear Marina,
I have problems to run even the simplest sample that i have already posted, the message that is showed by MC (latest beta) is:
--------------------------------------------------------------------------------
<<EXCEPTION>>
Address: 0x6C041405 ( 1812206597 )
Code: 0xC0000005 ( -1073741819 )
Continuable: 0x00000000 ( 0 )
Description: L'istruzione a "0x
ErrorCode: 0xC0000005 ( -1073741819 )
ExceptionType: 0x00000000 ( 0 )
Module: D:\Documents and Settings\All Users\Dati applicazioni\TS Support\MultiCharts\StudyServer\Studies\Dlls\Functions\f_fgetxaverage.dll
Process: C:\Programmi\TS Support\MultiCharts\MultiCharts.exe
Thread ID: 0x000005FC ( 1532 )
Time: 14.02.2008 - 21:03:18.671
--------------------------------------------------------------------------------
please, could you check what's wrong in the sample that I have sent or POST a simple but complete WORKING sample ?
Regards,
Danilo
I have problems to run even the simplest sample that i have already posted, the message that is showed by MC (latest beta) is:
--------------------------------------------------------------------------------
<<EXCEPTION>>
Address: 0x6C041405 ( 1812206597 )
Code: 0xC0000005 ( -1073741819 )
Continuable: 0x00000000 ( 0 )
Description: L'istruzione a "0x
ErrorCode: 0xC0000005 ( -1073741819 )
ExceptionType: 0x00000000 ( 0 )
Module: D:\Documents and Settings\All Users\Dati applicazioni\TS Support\MultiCharts\StudyServer\Studies\Dlls\Functions\f_fgetxaverage.dll
Process: C:\Programmi\TS Support\MultiCharts\MultiCharts.exe
Thread ID: 0x000005FC ( 1532 )
Time: 14.02.2008 - 21:03:18.671
--------------------------------------------------------------------------------
please, could you check what's wrong in the sample that I have sent or POST a simple but complete WORKING sample ?
Regards,
Danilo
- Andrew Kirillov
- Posts: 1589
- Joined: 28 Jul 2005
- Has thanked: 2 times
- Been thanked: 31 times
- Contact:
EasyLanguage_Reference_Guide.pdf (174 page of 292)
==================================================
Defining a DLL Function
_______________________
Before you can call a DLL function from EasyLanguage, you must declare the DLL using
a DLL Function Declaration statement.
Syntax:
DefineDLLFunc: “DLLNAME.DLL”, Return Type, “FunctionName”,Parameters ;
DLLNAME.DLL is the name of the DLL where the function resides, Return Type is the type
of expression the function will return,
FunctionName is the name of the function as defined in the DLL,
and Parameters is the list of parameters expected by the function (each parameter separated by a comma).
It is very important to remember that 32-bit DLLs use case-sensitive exported functions declared
using _cdecl, _ _stdcall , or fastcall.
For DLLs to be compatible with EasyLanguage,
exported functions should be created using all uppercase letters and be declared as _stdcall.
These exported functions must be listed within the EXPORTS section of the DLL’s .DEF
file. Using “_declspec (dllexport)” from the function’s prototype is not sufficient for
EasyLanguage to locate a DLL’s exported functions.
-----
You should define functions as _stdcall and add them in .DEF
-----
If you use it this way it will work fine. We’ve tested.
float __stdcall fl_GetXaverage(float Price, float lastX, float length);
LIBRARY "TestDLL"
EXPORTS
fl_GetXaverage @1
----
==================================================
Defining a DLL Function
_______________________
Before you can call a DLL function from EasyLanguage, you must declare the DLL using
a DLL Function Declaration statement.
Syntax:
DefineDLLFunc: “DLLNAME.DLL”, Return Type, “FunctionName”,Parameters ;
DLLNAME.DLL is the name of the DLL where the function resides, Return Type is the type
of expression the function will return,
FunctionName is the name of the function as defined in the DLL,
and Parameters is the list of parameters expected by the function (each parameter separated by a comma).
It is very important to remember that 32-bit DLLs use case-sensitive exported functions declared
using _cdecl, _ _stdcall , or fastcall.
For DLLs to be compatible with EasyLanguage,
exported functions should be created using all uppercase letters and be declared as _stdcall.
These exported functions must be listed within the EXPORTS section of the DLL’s .DEF
file. Using “_declspec (dllexport)” from the function’s prototype is not sufficient for
EasyLanguage to locate a DLL’s exported functions.
-----
You should define functions as _stdcall and add them in .DEF
-----
If you use it this way it will work fine. We’ve tested.
float __stdcall fl_GetXaverage(float Price, float lastX, float length);
LIBRARY "TestDLL"
EXPORTS
fl_GetXaverage @1
----
- Andrew Kirillov
- Posts: 1589
- Joined: 28 Jul 2005
- Has thanked: 2 times
- Been thanked: 31 times
- Contact: