[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: RE - Problem with calling DLL



PureBytes Links

Trading Reference Links

Thanks; - the SDK documentation is really sparse at best. Took me a damn long time to figure how to set everything up perfectly.

What's funny is that I spent about 40minutes searching for the various header and library files that Omega Research Programmed for interfacing TS with C++ (elkit32.h, elkitvc.lib, etc..)....haha, the buggers automatically install it for you in the omega research\program folder when you install tradestation; however, since this is really for developer use only, I figured they were on the CD and couldnt' figure out why there weren't in the developer kit section, lol

-Alex

Phil Bailey wrote:

Alex,

Very educational and one for the notebook.
Nice key points highlighted.


Thanks,
Phil


-----Original Message-----
From: Alex [mailto:SRTOmegaList@xxxxxxx]
Sent: Friday, April 08, 2005 2:02 PM
To: omega-list@xxxxxxxxxx
Subject: RE - Problem with calling DLL


Hi Shawn - some thoughts

1) Try temporarily putting it in another folder (e.g., c:\temp) to see if it's recognized there

2) Make certain you've compiled the DLL in EITHER Microsoft Visual Studio (preferably 5.0 or 6.0 ..... writting wrappers and other nonsense in the .NET versions is just silly for the amount of work it takes) or Borland. I write all my DLLs with MS Visual C++ 6.0 (I suppose you could write it with C++ .NET, but from what I've read there are SERIOUS headaches with the new managed C++ setup)

Although you can write your DLL in another language, I recommend against it - stick with C++, it will produces the least amount of headaches when trying to get it to work. Also, do NOT use any other compiler other than MS or Borland products - there are lots of freeware alternatives out there, but they compile DLLs differently and won't be compatible with TS (I knwo this for a fact since yesterday I spent like 2 or 3hrs playing around with a friend at work on a free C++ compiler and finally figured out that it wasn't compiling it the way TS would recognize it)

3) Make certain in the C++ code (assuming you're using C++, which you should be imho), you've tagged the function in the implementation file (*.cpp) as __stdcall - note teh double underscore

4) In the declaration file (*.h), make certain you've declared it as __declspec(dllexport)

5) **MOST IMPORTANTLY** make certain you have a definition file (*.def) that has the line EXPORTS followed by the functions that it will be exporting - this is where some freeware compilers mess up - they INSIST on buildng their own .def file, but TS needs the dll to have been built with a simple def file, like:
EXPORTS
MYFUNCTION1
MYFUNCTION2

6) make certain function name (in TS and C++) is all in caps

That should help you.

-Alex