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

RE - Problem with calling DLL



PureBytes Links

Trading Reference Links

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