I'm looking for an explanation about why using Global Variable string in Excel is causing erroneous data when it is modified
Excel code. Is it the proper way to declare the function?
When using
GVSetNamedString ("String1", "A test String", If I modify the string, I got erroneous data. The previous value is kept in part
If I use GVSetString(3, "This is my string"). I read back using GV_GetString(3) , a similar problem.
I have no problem at all with all the other Global Variable in either Excel and MC
MC way to define the dll
Code: Select all
DefineDLLFunc: "GlobalVariable.dll", lpstr, "GV_GetNamedString", lpstr, lpstr ;
As usual, any info appreciated.
Martin
Code in Excel
Code: Select all
Public Declare Function GV_SetNamedString Lib "C:\Program Files (x86)\TS Support\MultiCharts\GlobalVariable.dll" _
(ByVal strElementLoc As String, ByVal intSetValue As String) As Long
Public Declare Function GV_GetNamedString Lib "C:\Program Files (x86)\TS Support\MultiCharts\GlobalVariable.dll" _
(ByVal strElementLoc As String, ByVal strOther As String) As String
Public Declare Function GV_GetString Lib "C:\Program Files (x86)\TS Support\MultiCharts\GlobalVariable.dll" _
(ByVal intElementLoc As Long) As Long
Public Declare Function GV_SetString Lib "C:\Program Files (x86)\TS Support\MultiCharts\GlobalVariable.dll" _
(ByVal intElementLoc As Long, ByVal intSetValue As String) As Long