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

Re: trying again to write dll for ts6



PureBytes Links

Trading Reference Links

On Thu, 23 May 2002, Mike Eggleston wrote:

> I'm attempting to write an external to interface with other software. I
> have created a test case for the communication between TS6 and the dll.  I
> have been unable so far to get this dll interface to work. Would you please
> look at the code and tell me what is missing.
> 
> Mike

what an ordeal
unix is much easier
the function I ended with is

__declspec(dllexport) int __stdcall HOWARD(int a, int b, int c)
{
	time_t t;
	OPENFP;
	unlink("c:/temp/howard");
	LOG3("%s three values g=%d i=%d t=%d\n", a, b, c);
	return 4;
}

The bad number at the beginning of the fprintf is due to a mis-copy on
my part. The fprintf function was #define'd so I could easily put
a timestamp in the code. However, that did point me to the calling
sequence and after many  trials today, and many great suggestions from
the list, it is now working. I found that in addition to the calling
sequence above I also needed a *.def file and that file must be
specified to the loader. The *.def file I have is:

; charthistory.dll : accepts data from ts and then correlates the data when asked

LIBRARY      "charthistory"
;DESCRIPTION: "standard windows dynamic link library"

EXPORTS
; explicit exports can go here
	CCHISTCLEAR
	CCHISTADDCHAIN
	CCHISTADDEVENT
	CCHISTSCAN
	HOWARD

I hope this helps someone else!

Mike