Unable to debug in VB  [SOLVED]

Questions about MultiCharts .NET and user contributed studies.
szoi
Posts: 8
Joined: 29 Jan 2015
Has thanked: 7 times

Unable to debug in VB

Postby szoi » 03 Feb 2015

My environment is Windows 7 VS 2010 Ultimate Version 10.0.40219.1 SP1Rel

I've two blocking issues
The first is the famous message
Unable ti evaluate the expression
when I try to see a variable's value.
The second is an error raided when the calcbar executes any PL structure, for example

Code: Select all

m_avg = Me.m_averagefc1.Item(0)
or

Code: Select all

Dim m_sdev As Double = Me.bollingerprice.StandardDeviationCustom(length, 1)
the message is
ManagedStudies.details._ELAPI_exception_Wrap_ was unhandled by user code
Message: Error from the application
This happens when I use a Class wtitten in VB, and residing in an external module.
For example then indicator resides in
__zD_BinBol.Indicator.VB
end then class in in
zD_Lib1.Function.VB

PS
Please can you tell me how to add references to external assembly with PL editor?
I have then IB .NET version.

Thank you in advance

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

Re: Unable to debug in VB

Postby Henry MultiСharts » 04 Feb 2015

Hello szoi,

For "unable to evaluate the expression" error please see this post.

You do not need to catch the _ELAPI_exception_Wrap_ exception in VS as it is an internal message for the system.

Here is how to add a reference.

Emmanuel
Posts: 355
Joined: 21 May 2009
Has thanked: 109 times
Been thanked: 28 times

Re: Unable to debug in VB

Postby Emmanuel » 04 Feb 2015

Hi

I don t think this issue was solved with vs2012

Emmanuel

szoi
Posts: 8
Joined: 29 Jan 2015
Has thanked: 7 times

Re: Unable to debug in VB: *where I'm I wrong?*

Postby szoi » 23 Apr 2015

Hi Henry,
thank you very much for your support.
I'm still in trouble.
I've all the logic implemented in a DLL called MC_zD_
Here's the strategy code

Code: Select all

Imports MC_zD_.PowerLanguage.Strategy
Namespace PowerLanguage.Strategy
Public Class ___zDdebug2
Inherits __zD_PNunpRt
Public Sub New(ByVal _ctx As Object)
MyBase.New(_ctx)
End Sub
Protected Overrides Sub Create()
MyBase.Create()
End Sub
End Class
End Namespace
Anyway I still receive then prompt 'Unable to evaluate the expression' both outside and inside the DLL (see attached image)
Any suggestion?
Thanks
Attachments
ScreenShot025.png
Screenshot
(24.3 KiB) Downloaded 1848 times

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

Re: Unable to debug in VB

Postby Henry MultiСharts » 24 Apr 2015

szoi, you need to set the breakpoint in the code of your DLL, not in the code on MultiCharts .NET study. Please attach to MultiCharts before applying the study to a chart or start MultiCharts from VS.

szoi
Posts: 8
Joined: 29 Jan 2015
Has thanked: 7 times

Re: Unable to debug in VB

Postby szoi » 25 Apr 2015

Thank you for the fast reply
Henry, this is what I'm doing
I starts MC from VS, I've no breakpoints on MultiCharts .NET study code, and I break only in DLL, but I can't see variables anyway.
Please see the attached images
Attachments
MCreport.png
(544.09 KiB) Downloaded 1804 times

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

Re: Unable to debug in VB

Postby Henry MultiСharts » 27 Apr 2015

Thank you for the fast reply
Henry, this is what I'm doing
I starts MC from VS, I've no breakpoints on MultiCharts .NET study code, and I break only in DLL, but I can't see variables anyway.
Please see the attached images
On this screenshot the breakpoint is still set in the MultiCharts .NET study code, not in your DLL.

szoi
Posts: 8
Joined: 29 Jan 2015
Has thanked: 7 times

Re: Unable to debug in VB

Postby szoi » 28 Apr 2015

Sorry, Henry
I know this sounds very stupid from me, but I don't understand what means to put the breakpoint in the DLL.
My breakpoint is in the code from DLL,
(22mflq4o.dll.VB.netmodule!PowerLanguage.PostNewsSrtInd.CalcBar Line 36), and I don't know to breack elsewhere.
Attachments
ScreenShot035.png
(16.24 KiB) Downloaded 1677 times

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

Re: Unable to debug in VB

Postby Henry MultiСharts » 01 May 2015

Sorry, Henry
I know this sounds very stupid from me, but I don't understand what means to put the breakpoint in the DLL.
My breakpoint is in the code from DLL,
(22mflq4o.dll.VB.netmodule!PowerLanguage.PostNewsSrtInd.CalcBar Line 36), and I don't know to breack elsewhere.
szoi, please try these instructions:
http://stackoverflow.com/questions/9431 ... int-in-dll
http://stackoverflow.com/questions/2617 ... ual-studio

szoi
Posts: 8
Joined: 29 Jan 2015
Has thanked: 7 times

Re: Unable to debug in VB

Postby szoi » 04 May 2015

Very strange!
I've followed all the instructions: I've added the DLL project, (MC_zD_) to the solution, cleared all the breakpoints and started the debug session, and the issue is still there.
Attachments
ScreenShot042.png
(59.08 KiB) Downloaded 1867 times

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

Re: Unable to debug in VB

Postby Henry MultiСharts » 05 May 2015

Very strange!
I've followed all the instructions: I've added the DLL project, (MC_zD_) to the solution, cleared all the breakpoints and started the debug session, and the issue is still there.
On this screenshot the breakpoint is still set in the MultiCharts .NET *.dll.VB.netmodule in StartCalc method.

szoi
Posts: 8
Joined: 29 Jan 2015
Has thanked: 7 times

Re: Unable to debug in VB

Postby szoi » 09 May 2015

Henry, I'm afraid of abusing of your patience, but I've a blind spot, and I'm not finding the way.
Please can you revise my procedure to find where I'm wrong?
1. All the logic, is in a separate DLL, as in this post
2. The strategy code, just contains the New and the Create procedures, which just calls the DLL's homonymous. This way all the code is in the DLL.
3. In my test VS solutions, there are two projects: the DLL (as in http://stackoverflow.com/questions/9431 ... int-in-dll), and the debug project, with the minimal strategy code.
4. To start debugging, I implicitly start C:\Program Files\TS Support\MultiCharts .NET64 for TWS\MultiCharts64.exe (specified as parameter in Debug --> Start external program)
5. I set the breakpoints only in the DLL code, from the DLL's project .
6. The debug session starts correctly, and the breakpoints are executed.
7. At this point I believe to be in the DLL code, while I'm still in the MultiCharts .NET study code.
Where's the bug?
Thank you in advance

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

Re: Unable to debug in VB  [SOLVED]

Postby Henry MultiСharts » 12 May 2015

szoi, please see the attached images with the description. We have also verified that this bug is now fixed in Visual Studio 2013. Which means you can now use it to debug your VB code directly.
Image
Image
Attachments
good.png
(171.97 KiB) Downloaded 1837 times
bad.png
(227.73 KiB) Downloaded 1870 times


Return to “MultiCharts .NET”