Calls to C# dlls

Questions about MultiCharts and user contributed studies.
Jad
Posts: 92
Joined: 15 Jun 2014
Has thanked: 13 times
Been thanked: 21 times

Calls to C# dlls

Postby Jad » 27 Nov 2014

I have a couple of questions:

1.Using the following C# dll as an example ....

Code: Select all

public class ManagedClass : ICalculator
{
public int Add(int Number1, int Number2)
{
return Number1 + Number2;
}
}
How should I reference such a function/method in my EasyLanguage 'external' call?
-----------------------------------------------------------------------------------------------

2. A call to the following C# dll works OK

Code: Select all

public class TestClass
{
public static string ConcatString(string left, string right)
{
return left + right;
}
}
...returns the two strings that are sent to it and they are also concatenated as expected but....

Code: Select all

public class TestClass
{
public static string ConcatAndModify(ref string left, ref string right)
{
string str = left + right;
left = "12345678";
right = "87654321";
return str;
}
}
.... results in the following error:

<<EXCEPTION>>
Code: 0xFFFFFFFFC0000005 ( -1073741819 )
Continuable: 0x0000000000000000 ( 0 )
Description: The instruction at 0x
ErrorCode: 0xFFFFFFFFC0000005 ( -1073741819 )
ExceptionType: 0x0000000000000000 ( 0 )
Module: C:\Windows\system32\MSVCR120_CLR0400.dll
Process: C:\Program Files\TS Support\MultiCharts64\MultiCharts64.exe
Thread ID: 0x0000000000000710 ( 1808 )
Time: 27.11.2014 - 14:52:38.731

I have ensured that the values initially sent are only 8 characters in length and I have also tried making the call to ConcatAndModify from Multicharts using 'string' and/or 'lpstr' but it makes no difference and I still receive the error above. Does anyone know why an error is occurring?

Many thanks.

User avatar
Henry MultiСharts
Posts: 9165
Joined: 25 Aug 2011
Has thanked: 1264 times
Been thanked: 2957 times

Re: Calls to C# dlls

Postby Henry MultiСharts » 01 Dec 2014

Jad, as far as I am aware of - Christina is already working on this issue with you. Please continue with her.

Jad
Posts: 92
Joined: 15 Jun 2014
Has thanked: 13 times
Been thanked: 21 times

Re: Calls to C# dlls

Postby Jad » 01 Dec 2014

Jad, as far as I am aware of - Christina is already working on this issue with you. Please continue with her.
Thanks Henry, I originally asked about this on the 25th Nov. and although another question in the same email was addressed, this one wasn't. With the holidays, I wasn't sure if/when it would be and so I thought I'd ask here too in case anyone else had an answer.

FATSTrader
Posts: 15
Joined: 14 Feb 2011
Has thanked: 7 times
Been thanked: 3 times

Re: Calls to C# dlls

Postby FATSTrader » 21 Dec 2014

Hi Jad,

I am trying to access a VS 2013 Express DLL from MC64 and the study does not see the function.

Can you post the PowerLanguage study with the call to your DLL below:

public class ManagedClass : ICalculator
{
public int Add(int Number1, int Number2)
{
return Number1 + Number2;
}
}

Also, what C# IDE and version did you use?
Appreciate your help!

Jad
Posts: 92
Joined: 15 Jun 2014
Has thanked: 13 times
Been thanked: 21 times

Re: Calls to C# dlls

Postby Jad » 22 Dec 2014

I have been working in VS2013 Pro. My questions are still being looked into but a couple have been partially resolved. There are a couple of ways to do it. The best one really depends upon what exactly your dll is going to do. Send me an email and I'll send you the VS2013 projects if you like and I'll update you as and when things progress.


Return to “MultiCharts”