GV Code working in Multicharts64 but not Multicharts  [SOLVED]

Questions about MultiCharts and user contributed studies.
User avatar
bensat
Posts: 331
Joined: 04 Oct 2014
Has thanked: 46 times
Been thanked: 104 times

GV Code working in Multicharts64 but not Multicharts

Postby bensat » 16 Jan 2016

MultiCharts64 Version 9.0 Release (Build 11210)
MultiCharts Version 9.0 Release (Build 11213)

I have following code which kept me busy the hole day while I was trying to get it working in Multicharts (32bit). It's not working in the 32bit version with output of the plots1 & 2 as -1. Here is the code :

Code: Select all

DefineDLLFunc: "GlobalVariable.dll", int, "GV_SetDouble", int, double ;
DefineDLLFunc: "GlobalVariable.dll", int, "GV_SetString", int, lpstr ;

inputs: SymNum(1000),
StrValue("Test @"),
Level( 9777.0 ) ;

variables:
SetRtnVal( -1 ),
SetStrVal( -1 ),
locElement1( "" ),
ID1(0),
locElement2( "" ),
ID2(0);


locElement1 = numtostr(symnum,0)+"1";
ID1 = strtonum(locElement1);
locElement2 = numtostr(symnum,0)+"2";
ID2 = strtonum(locElement2);



SetRtnVal = GV_SetDouble(ID1 , Level ) ;
SetStrVal = GV_SetString(ID2 , StrValue ) ;

Plot1( SetRtnVal, "Double" ) ;
Plot2( SetStrVal, "String" );


Print ( "Receiver : ", " Output >> elementlocation is : ", locElement1, " : " , "ID is : ", ID1, " PlotValue is : " , SetRtnVal);
Print ( "Receiver : ", " Output >> elementlocation is : ", locElement2, " : " , "ID is : ", ID2, " PlotValue is : " , SetStrVal)
The same code is working pretty well with the correct outputs as 10001 and 10002. Both versions are installed on two different virtual machines running WS2012R2.

Someone has an idea ? I just gave up right now as I do not have an explanation or any idea why the x32bit version of MC gives me a wrong output while the 64bit version just working fine.

Regards.

Ben

mickatrade
Posts: 114
Joined: 12 Jul 2015
Has thanked: 20 times
Been thanked: 16 times

Re: GV Code working in Multicharts64 but not Multicharts

Postby mickatrade » 17 Jan 2016

Hello Bensat,

Did you install gv2.2 for 32bit ? it's not installed by default on 32bits versions of MC.
See this post :
viewtopic.php?t=2483

MJ

User avatar
bensat
Posts: 331
Joined: 04 Oct 2014
Has thanked: 46 times
Been thanked: 104 times

Re: GV Code working in Multicharts64 but not Multicharts  [SOLVED]

Postby bensat » 17 Jan 2016

Thank you for your answer. GV is originally installed with MC 32bit. There already is a 'GlobalVariable.dll' in the Multicharts folder. Even a dll-interchange does not help. I switched the generated indicators from both OS's and on MC64 it's always working. That means the code exported from MC64 gives the incorrect '-1'-output in MC32. Vica versa the MC32 code exported gives the correct output on CM64.

So must be the 32bit environment.

Regards

Ben


EDIT :

I found my solution ... Due to the logic the 'symnum' plus the convert into a string send the data out of the 10000 area where 'GlobalVariable' is storing the data.

Thank you anyway.

Regards.

Ben


Return to “MultiCharts”