![]() |
|
|||||||
| General Programming General NinjaScript programming questions. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
|
|
#1 |
|
Senior Member
Join Date: Nov 2009
Posts: 205
Thanks: 0
Thanked 0 times in 0 posts
|
Im referencing Gobal Variables.dll (that I took from Tradestation) and trying to follow what mktrend has done in the following post...
http://www.ninjatrader.com/support/f...335#post179335 but I am getting the following Error when I compile my script that references it? Metadata file 'c:\Users\Morgan\Documents\NinjaTrader 7\bin\Custom\GlobalVariable.dll' could not be opened -- 'An attempt was made to load a program with an incorrect format. ' I know this DLL works in Tradestation as I have used it myself |
|
|
|
|
|
#2 |
|
NinjaTrader Customer Service
Join Date: Sep 2008
Location: Germany
Posts: 22,377
Thanks: 252
Thanked 966 times in 949 posts
|
mefTrader, unfortunately this would be outside of the scope we can support here - did you restart NT fresh after the DLL was copied in?
Bertrand
NinjaTrader Customer Service |
|
|
|
|
|
#3 |
|
Senior Member
Join Date: Nov 2009
Posts: 205
Thanks: 0
Thanked 0 times in 0 posts
|
Yes I did and still get the same Response
where should the following code go in Ninja Script (before declarations, in variables section??) [DllImport("GlobalVariable.dll")] public static extern int GV_SetInteger(int iLocation, int iVal); [DllImport("GlobalVariable.dll")] public static extern int GV_GetInteger( int iLocation) ; int GV1 = GV_SetInteger(1, 33); int GV2 = GV_GetInteger(1); |
|
|
|
|
|
#4 |
|
NinjaTrader Customer Service
Join Date: Sep 2008
Location: Germany
Posts: 22,377
Thanks: 252
Thanked 966 times in 949 posts
|
Is the DLL potentially available in more than one location on the system?
Those would likely go to variables yes.
Bertrand
NinjaTrader Customer Service |
|
|
|
|
|
#5 |
|
Senior Member
Join Date: Nov 2009
Posts: 205
Thanks: 0
Thanked 0 times in 0 posts
|
Yes but I am telling Ninja which one to reference by right clicking on the chart and selecting Reference and then Add...
|
|
|
|
|
|
#6 |
|
NinjaTrader Customer Service
Join Date: Sep 2008
Location: Germany
Posts: 22,377
Thanks: 252
Thanked 966 times in 949 posts
|
Perhaps try without a reference, just by pointing to the DLL's path as shown in other thread.
Bertrand
NinjaTrader Customer Service |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Custom Dll | trend | Version 7 Beta General Questions & Bug Reports | 9 | 06-28-2010 08:55 AM |
| Missing DLL error. | Shyam | Miscellaneous Support | 1 | 06-27-2010 07:25 AM |
| Accessing a custom DLL | bubblegum | General Programming | 3 | 06-08-2010 09:34 AM |
| Strategy DLL | Bobby-Wan | Strategy Development | 1 | 06-07-2010 04:33 AM |
| How to compile indicator to DLL | dbtrader | General Programming | 3 | 06-03-2010 07:47 AM |