Page 1 of 1

Unable to debug in VB

Posted: Feb 03 2015
by szoi
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

Re: Unable to debug in VB

Posted: Feb 04 2015
by Henry MultiСharts
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.

Re: Unable to debug in VB

Posted: Feb 04 2015
by Emmanuel
Hi

I don t think this issue was solved with vs2012

Emmanuel

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

Posted: Apr 23 2015
by szoi
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

Re: Unable to debug in VB

Posted: Apr 24 2015
by Henry MultiСharts
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.

Re: Unable to debug in VB

Posted: Apr 25 2015
by szoi
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

Re: Unable to debug in VB

Posted: Apr 27 2015
by Henry MultiСharts
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.

Re: Unable to debug in VB

Posted: Apr 28 2015
by szoi
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.

Re: Unable to debug in VB

Posted: May 01 2015
by Henry MultiСharts
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

Re: Unable to debug in VB

Posted: May 04 2015
by szoi
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.

Re: Unable to debug in VB

Posted: May 05 2015
by Henry MultiСharts
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.

Re: Unable to debug in VB

Posted: May 09 2015
by szoi
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

Re: Unable to debug in VB  [SOLVED]

Posted: May 12 2015
by Henry MultiСharts
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