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

Re: porting a DLL to TS2K



PureBytes Links

Trading Reference Links


Make sure you have the function's name listed as an Export within the .def file, otherwise the name will get mangled (in the C++ overloading sense of the word.) I didn't make sure the names were in uppercase, and it worked fine for me.

Also, since you are trying to export the name from the DLL to TS, 

use this declaration:

__declspec( dllexport ) instead of DLLImport

or, use the DLLExport macro in your .h file, instead of the DLLImport. This is documented within the sample code if you let VC++ build you a sample "Win-32 Dynamic Link Library" and then choose "A DLL that exports some symbols".

HTH

Mike G.


>I have a DLL that I use with TS 4.0.  I would like to use its 32-bit 
>counterpart with TS 2K.  When I try to access the functions, I get a 
>message from TS2K that the function cannot be found.  The EL Ref Manual 
>says that, "It is very important to remember that 32-bit DLLs use 
>case-sensitive exported functions declared using _cdecl, __stdcall, or 
>fastcall.  For DLLs to be compatible with Easy Language, exported functions 
>should be created using all uppercase letters and be declared as _stdcall."
>
>Here's the .h file I have for my DLL.  Anyone have any suggestions on how 
>to modify it for TS2K?
>
>Thanks!
>Chris
>
>#ifndef _MYDLL_H
>#define _MYDLL_H
>
>#ifndef _MYEXP_INCLUDED
>#include "myexp.h"
>#endif
>
>#ifdef USE_DLL16 /* 16bit DLL */
>#define DllImport extern
>#else
># ifdef __cplusplus
>#define DllImport extern "C" __declspec( dllimport )
># else
>#define DllImport  __declspec( dllimport )
># endif
>#endif
>
>DllImport void FAR PASCAL set_path(char *path);