NinjaTrader Support Forum  

Go Back   NinjaTrader Support Forum > NinjaScript Development Support > General Programming

General Programming General NinjaScript programming questions.

Reply
 
Thread Tools Display Modes
Old 07-16-2010, 05:22 AM   #1
mefTrader
Senior Member
 
Join Date: Nov 2009
Posts: 205
Thanks: 0
Thanked 0 times in 0 posts
Default NT7 - Referrencing GlobalVariables.dll

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
mefTrader is offline  
Reply With Quote
Old 07-16-2010, 05:32 AM   #2
NinjaTrader_Bertrand
NinjaTrader Customer Service
 
NinjaTrader_Bertrand's Avatar
 
Join Date: Sep 2008
Location: Germany
Posts: 22,377
Thanks: 252
Thanked 966 times in 949 posts
Default

mefTrader, unfortunately this would be outside of the scope we can support here - did you restart NT fresh after the DLL was copied in?
NinjaTrader_Bertrand is offline  
Reply With Quote
Old 07-16-2010, 05:36 AM   #3
mefTrader
Senior Member
 
Join Date: Nov 2009
Posts: 205
Thanks: 0
Thanked 0 times in 0 posts
Default

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);


mefTrader is offline  
Reply With Quote
Old 07-16-2010, 05:45 AM   #4
NinjaTrader_Bertrand
NinjaTrader Customer Service
 
NinjaTrader_Bertrand's Avatar
 
Join Date: Sep 2008
Location: Germany
Posts: 22,377
Thanks: 252
Thanked 966 times in 949 posts
Default

Is the DLL potentially available in more than one location on the system?

Those would likely go to variables yes.
NinjaTrader_Bertrand is offline  
Reply With Quote
Old 07-16-2010, 06:03 AM   #5
mefTrader
Senior Member
 
Join Date: Nov 2009
Posts: 205
Thanks: 0
Thanked 0 times in 0 posts
Default

Yes but I am telling Ninja which one to reference by right clicking on the chart and selecting Reference and then Add...
mefTrader is offline  
Reply With Quote
Old 07-16-2010, 06:16 AM   #6
NinjaTrader_Bertrand
NinjaTrader Customer Service
 
NinjaTrader_Bertrand's Avatar
 
Join Date: Sep 2008
Location: Germany
Posts: 22,377
Thanks: 252
Thanked 966 times in 949 posts
Default

Perhaps try without a reference, just by pointing to the DLL's path as shown in other thread.
NinjaTrader_Bertrand is offline  
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

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


All times are GMT -6. The time now is 10:10 AM.