Request : dll example

Questions about MultiCharts and user contributed studies.
blueysnow
Posts: 5
Joined: 25 May 2009

Request : dll example

Postby blueysnow » 23 Oct 2009

Currently I am trying to write down dll code.

I couldn't find any example on this topic.

anyone can provide to me an example?

Thanks

User avatar
TJ
Posts: 7740
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1033 times
Been thanked: 2221 times

Postby TJ » 23 Oct 2009

what do you want to use to write the DLL?

what would you like a DLL to do for you?

are you a programmer? or taken a course on programming? or writing DLL?


.
Last edited by TJ on 24 Oct 2009, edited 3 times in total.

blueysnow
Posts: 5
Joined: 25 May 2009

To make my own strategy

Postby blueysnow » 23 Oct 2009

I need to calculate my own logic which can not be performed under the EL.
By calling dll, I want to get the result from my dlll module.

What I need is, sample source code which includes EL & dll source code.

wegi
Posts: 124
Joined: 02 Jun 2009
Has thanked: 5 times
Been thanked: 13 times

Re: To make my own strategy

Postby wegi » 24 Oct 2009

Whats your compiler ?
I use visual studio 6.0 c++ and i coded some DLLs.

blueysnow
Posts: 5
Joined: 25 May 2009

My compiler is VC++ 6.0

Postby blueysnow » 24 Oct 2009

If you can show some example, it will be greately helpful to me.

Thanks wegi

wegi
Posts: 124
Joined: 02 Jun 2009
Has thanked: 5 times
Been thanked: 13 times

Postby wegi » 26 Oct 2009

Sorry for my late answere, here is an example...


New -> Projekt -> win32 dynamic Link Library


SampleCode for the Funktion:
The Function returns an ascii charater by an given integer value.
If you need a tab to print it in a file, call the function with value 9.

Code: Select all

extern "C" LPCSTR __declspec( dllexport ) __stdcall intToAsc(int v)
{

try{

char buffer [255];
sprintf (buffer,"%c", v);

return buffer;

}
catch(...){
LPCSTR sValue = "ERR EXCEPTION";
return sValue;
}

}
Create a DEF File to declare the functions exported

Code: Select all

EXPORTS intToAsc

Easylanguage Code:

Code: Select all

vars: tab("");

DefineDLLFunc: "dlltest.dll", lpstr, "intToAsc", int;

if tab = "" then tab = intToAsc(9);

blueysnow
Posts: 5
Joined: 25 May 2009

Thanks

Postby blueysnow » 27 Oct 2009

:lol: :lol:


Return to “MultiCharts”