[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

Dear Mike/List,
Although not in VC but in Clarion I made several DLL's for TS.
Some things are just very "tricky" to do and that includes FILEIO and
EVENT-PROCESSING (you are not running on a seperate thread and you do not
have a "window" where you can post/get your events from).
Try to do something simple (like passing a long adding one to it and than
plot that value in TS).
Any discrepancy in variable type, length or nr of them will crash TS and/or
the DLL.
Have fun
Robert

ps. What is your goal (what should the DLL do) ?
ps2. If you do get a skeleton DLL in VC that works maybe you can post it to
the list.
----- Original Message -----
From: "Mike Eggleston" <mikee@xxxxxxxxxxxxxx>
To: <omega-list@xxxxxxxxxx>
Sent: Thursday, May 23, 2002 1:07 PM
Subject: trying again to write dll for ts6


> 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
>
> -------------- C code -----------------
>
> #include <windows.h>
> #include <time.h>
> #include <stdio.h>
> #include <sys/types.h>
>
> #ifdef __cplusplus
> extern "C" {
> #endif
> void __declspec(dllexport) CCHISTADDCHAIN(int group, int id, int
timeinterval);
> #ifdef __cplusplus
> }
> #endif
>
> void __declspec(dllexport) CCHISTADDCHAIN(int group, int id, int
timeinterval)
> {
> FILE *fp = fopen("c:\\temp\\cctest1", "a");
> time_t tm;
> (void) time(&tm);
> (void) fprintf(fp, "%s received g=%d i=%d t=%d\n", group, id,
timeinterval);
> (void) fclose(fp);
> }
> ----------------------------------------
>
> -------------- EL Indicator ------------
> Inputs: price(c), group(1), indid(1);
>
> DefineDLLFunc: "c:\tmp\charthistory.dll", VOID, "CCHISTADDCHAIN", int,
int, int;
>
> if currentbar = 1 then begin
> CCHistAddChain(group, indid, BarInterval);
> end;
> plot1(price);
> ----------------------------------------
>
> The error I receive from TS6 when this indicator is turned on is:
> The instruction at "0x03764e3c" referenced memory at "0x00000001". The
> memory could not be "read".
>
>
>