Defining Global Variable using "defineDllFunc"  [SOLVED]

Questions about MultiCharts and user contributed studies.
arjfca
Posts: 1292
Joined: 23 Nov 2010
Has thanked: 725 times
Been thanked: 223 times

Defining Global Variable using "defineDllFunc"  [SOLVED]

Postby arjfca » 24 Aug 2014

Hello

I'm looking for info on how to define all the global variable directly using the defineDllFunc. I just can't get them to compile

ex from the GL info:
DefineDLLFunc: "GlobalVariable.dll", int, "GV_GetInteger", int ;
DefineDLLFunc: "GlobalVariable.dll", int, "GV_SetInteger", int,

How to define for:
GV_SetNamedString
GV_GetNamedString

GV_SetNamedInt
GV_GetNamedInt

My actual code give compile error at the GLVal = GV_SetNamedString("test12","this is a test");

Code: Select all

definedllfunc: "C:\Program Files (x86)\TS Support\MultiCharts\GlobalVariable.dll",String,"GV_SetNamedString",Int;
definedllfunc: "C:\Program Files (x86)\TS Support\MultiCharts\GlobalVariable.dll",String,"GV_GetNamedString",string;

GLVal = GV_SetNamedString("test12","this is a test");
Martin

User avatar
TJ
Posts: 7742
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1033 times
Been thanked: 2222 times

Re: Defining Global Variable using "defineDllFunc"

Postby TJ » 24 Aug 2014

Hello

I'm looking for info on how to define all the global variable directly using the defineDllFunc. I just can't get them to compile

ex from the GL info:
DefineDLLFunc: "GlobalVariable.dll", int, "GV_GetInteger", int ;
DefineDLLFunc: "GlobalVariable.dll", int, "GV_SetInteger", int,

How to define for:
GV_SetNamedString
GV_GetNamedString

GV_SetNamedInt
GV_GetNamedInt

My actual code give compile error at the GLVal = GV_SetNamedString("test12","this is a test");

Code: Select all

definedllfunc: "C:\Program Files (x86)\TS Support\MultiCharts\GlobalVariable.dll",String,"GV_SetNamedString",Int;
definedllfunc: "C:\Program Files (x86)\TS Support\MultiCharts\GlobalVariable.dll",String,"GV_GetNamedString",string;

GLVal = GV_SetNamedString("test12","this is a test");
Martin
see post #6
viewtopic.php?f=16&t=6929&hilit=float


ps. make sure it is from Reuben's :-)

arjfca
Posts: 1292
Joined: 23 Nov 2010
Has thanked: 725 times
Been thanked: 223 times

Re: Defining Global Variable using "defineDllFunc"

Postby arjfca » 24 Aug 2014


ps. make sure it is from Reuben's :-)
OK, never taste them :) :)

Here is the code that compile ok but still returned the wrond string value

Code: Select all

definedllfunc: "C:\Program Files (x86)\TS Support\MultiCharts\GlobalVariable.dll",int, "GV_SetNamedString", lpstr, lpstr ;
definedllfunc: "C:\Program Files (x86)\TS Support\MultiCharts\GlobalVariable.dll",lpstr, "GV_GetNamedString",lpstr, lpstr;

GLVal = GV_SetNamedString("test12","this is a test");
GLString = GV_GetNamedString("Test12","Error_1");
Print (GLVal:0:0, " ", GlString);
Returned value:

216 Error_1
216 Error_1

Bye the way, I still have my indicator run twice, and indicator applied to only one instrument.

Martin

User avatar
TJ
Posts: 7742
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1033 times
Been thanked: 2222 times

Re: Defining Global Variable using "defineDllFunc"

Postby TJ » 24 Aug 2014


ps. make sure it is from Reuben's :-)
OK, never taste them :) :)

Here is the code that compile ok but still returned the wrond string value

Code: Select all

definedllfunc: "C:\Program Files (x86)\TS Support\MultiCharts\GlobalVariable.dll",int, "GV_SetNamedString", lpstr, lpstr ;
definedllfunc: "C:\Program Files (x86)\TS Support\MultiCharts\GlobalVariable.dll",lpstr, "GV_GetNamedString",lpstr, lpstr;

GLVal = GV_SetNamedString("test12","this is a test");
GLString = GV_GetNamedString("Test12","Error_1");
Print (GLVal:0:0, " ", GlString);
Returned value:

216 Error_1
216 Error_1

Bye the way, I still have my indicator run twice, and indicator applied to only one instrument.

Martin
The run twice is also happening to your ONCE code.
You must have some kind of debugging turned on.

User avatar
TJ
Posts: 7742
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1033 times
Been thanked: 2222 times

Re: Defining Global Variable using "defineDllFunc"

Postby TJ » 24 Aug 2014

::
Here is the code that compile ok but still returned the wrond string value
::
Returned value:

216 Error_1
216 Error_1
::
Martin
What string value were you expecting?

User avatar
TJ
Posts: 7742
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1033 times
Been thanked: 2222 times

Re: Defining Global Variable using "defineDllFunc"

Postby TJ » 24 Aug 2014

GLVal = GV_SetNamedString( "test12"
GLString = GV_GetNamedString( "Test12"
Can you see the error?


Return to “MultiCharts”