• New blog post: December 1st, the Donnans relocate to London http://tinyurl.com/3tdrm7 17 hrs ago
  • Ready for bedy. 1 day ago
  • I GOT ALL 4 UK VISAS APPROVED TODAY! WOOHOO!! 2 days ago
  • Waiting for the British Consulate in New York to approve entry to the UK for my family. They have their stacks of docs from me this AM. 4 days ago
  • Sending off final 'Applications for Entry to the United Kingdom' for my entire family. What a great load of painful paperwork! 5 days ago
  • letting Shannon go into Michael's ... without me. 6 days ago
  • More updates...

Powered by Twitter Tools.

June 2004
M T W T F S S
« Sep   Jul »
 123456
78910111213
14151617181920
21222324252627
282930  

Chris Donnan : Programming - Brooklyn Style

software, trading, family, fun

TradeStation platform interoperation - using GlobalVariables
Many folks in the TradeStation community have requested this vanilla functionality. The GlobalVariable.dll is here:
http://www.tradestationsupport.com/discussions/Topic_Archive.aspx?Topic_ID=19622
The C++ source is there as well. Basically - the C++ code allocates a shared memory block and then the GlobalVariable.dll 
is used to put/ get from it - thus sharing between multiple exe's. Have fun. 
-Chris
PS - there is also lots of code/ examples of c++ (win32) and c# interop at TradeStationworld.com search c# and you can 
see all my posts and code.
using System;
using System.Runtime.InteropServices;
namespace TradeStation.Interop
{
public class GlobalVariables
{

[DllImport("GlobalVariable.dll")]
public static extern int  GV_SetInteger( int iLocation, int iVal ) ;

[DllImport("GlobalVariable.dll")]
public static extern int  GV_GetInteger( int iLocation ) ;

[DllImport("GlobalVariable.dll")]
public static extern int  GV_SetNamedInt( string sIntVarName, int iVal ) ;

[DllImport("GlobalVariable.dll")]
public static extern int  GV_GetNamedInt( string sIntVarName, int iErrorCode ) ;

[DllImport("GlobalVariable.dll")]
 public static extern int  GV_SetFloat( int iLocation, float fVal ) ;

[DllImport("GlobalVariable.dll")]
 public static extern float  GV_GetFloat( int iLocation ) ;

[DllImport("GlobalVariable.dll")]
public static extern int  GV_SetNamedFloat( string sFloatVarName, float fVal ) ;

[DllImport("GlobalVariable.dll")]
public static extern float  GV_GetNamedFloat( string sFloatVarName, float fErrorCode ) ;

[DllImport("GlobalVariable.dll")]
public static extern int  GV_SetDouble( int iLocation, double dVal ) ;

[DllImport("GlobalVariable.dll")]
public static extern double  GV_GetDouble( int iLocation ) ;

[DllImport("GlobalVariable.dll")]
public static extern int  GV_SetNamedDouble( string sDoubleVarName, double dVal ) ;

[DllImport("GlobalVariable.dll")]
public static extern double  GV_GetNamedDouble( string sDoubleVarName, double dErrorCode ) ;

[DllImport("GlobalVariable.dll")]
public static extern int  GV_SetString( int iLocation, string sVal ) ;

[DllImport("GlobalVariable.dll")]
 public static extern int  GV_SetNamedString( string sStringVarName, string sVal ) ;

[DllImport("GlobalVariable.dll", EntryPoint="GV_GetNamedString")]
static extern IntPtr GetNamedString( string sStringVarName, string sErrorCode ) ;

[DllImport("GlobalVariable.dll", EntryPoint="GV_GetString")]
 static extern IntPtr GetString( int iLocation ) ;

 public static string GV_GetString( int iLocation )
{
IntPtr ptr = GetString(iLocation);
//return Marshal.PtrToStringAuto(ptr);
return Marshal.PtrToStringAnsi(ptr);
}

public static string GV_GetNamedString( string sStringVarName, string sErrorCode )
{
IntPtr ptr = GetNamedString(sStringVarName,sErrorCode);
//return Marshal.PtrToStringAuto(ptr);
return Marshal.PtrToStringAnsi(ptr);
}

}
}
Share and Enjoy:
  • del.icio.us
  • digg
  • blinkbits
  • BlinkList
  • blogmarks
  • YahooMyWeb
  • connotea
  • De.lirio.us
  • Fark
  • Furl
  • Reddit
  • description
  • Shadows
  • Smarking
  • Spurl
  • TailRank
  • Wists

Comment on this post below

You must be logged in to post a comment.


You can leave a response, or trackback from your own site.


«