I am trying to use TurboActivate.dll in my strategy in NinjaTrader (NT).
NT allows custom strategy development in a C# "group compiled" (my term) environment. In other words, every strategy and indicator package, delivered as a C# assembly is compiled into one massive executable. As a result, I do not have much control over application execution - and no control over build options.
I added TurboActivate.cs to the compile directory, and it will be included in my assembly. I placed TurboActivate.dll in the folder where NT specifies for external DLLs.
When I compile my strategy (a C# class in its own .cs file derived from one of the NT built-in classes), I get the following error: Metadata file 'c:\Users\Mark\Documents\NinjaTrader 7\bin\Custom\TurboActivate.dll' could not be opened -- 'An attempt was made to load a program with an incorrect format. '
When I do a little research on that error on the net I found this reference that seems the most likely to be the problem: http://blogs.msdn.com/b/arvindsh/archive/2009/06/21/tip-of-the-day-an-attempt-was-made-to-load-a-program-with-an-incorrect-format-net-p-invoke-issue.aspx. The author states:"After some troubleshooting it turned out that this utility was trying to load a plain-old DLL presumably using P/Invoke. The DLL was built for 32-bit platforms. Now it turns out that by design a 64-bit process (the 3rd party utility would run as a 64-bit process owing to the 64-bit .NET runtime) would be prevented from loading a non-COM 32-bit DLL (32-bit COM DLLs are loaded in a DLLHOST.EXE surrogate when invoked from a 64-bit client process, BTW...) with the above exception."
The author provides a solution using the corflags utility. Is it possible that this is the problem/solution? If not, do you have any recommendations?
Thanks,