Debug using Visual Studio without having to restart WL?
Author: BostonFern123
Creation Date: 11/12/2010 2:02 AM
profile picture

BostonFern123

#1
I recently learned to use Visual Studio 2010 to develop codes for WealthLabPro. While Visual Studio 2010 does make the development and debugging process much more pleasant and simpler, I'm less happier about the fact that every time I made a modification to my codes, I had to shutdown WealthLabPro and restart it. WealthLabPro 6.0 is a big program that takes a while to load, which means this repeated task is not just tedious, but also slow down my development.

Is there a way that I can get around this restarting problem?
profile picture

Eugene

#2
A way to ride a car through the whole country without having to refill all the time. Yes, this is how it sounds like.

What you called a "problem" is how the operating system and applications work: they load DLLs into memory at startup. Once your DLL (e.g. indicator library) is loaded, and you make a change to the code, WL6 has to be shut down because the code has to be recompiled by Visual Studio.
profile picture

BostonFern123

#3
It has been many years since I wrote my last DLL, so please correct me if I were wrong.

My understanding is that DLL is called dynamically loaded libraries, which means they are only loaded when they are needed, and the very purpose of DLL to prevent programs from loading codes that may not be needed later.

profile picture

Eugene

#4
QUOTE:
that may not be needed later.

This is the key: they may be needed later. Indicator libraries are scanned for indicators on startup to populate the Indicators list to be accessible at any time. Now if you remove an indicator or change its parameters, what do we do? Throw an exception? Crash? So, Indicator libraries can't be unloaded.

At the same time (on startup), the PosSizer dialog is populated with the list of PosSizers found in the various PosSizer libraries. The list is scanned only once when it's really needed - when WL starts. Just a couple of illustrations. Hope that makes it clear as to why Wealth-Lab has no reason to unload any DLL like these.
QUOTE:
but also slow down my development.

Having produced almost 20 published extensions using Visual Studio Express i.e. even without "Attach to Process" debugging feature, I couldn't say that restarting WL slowed down the development. Restarting Wealth-Lab under debugger takes much less than half a minute even when it's packed with nearly all existing Extensions. Compared with the time spent on refining your algorithms and coding the routines, it's still omissible even when these times build up.
profile picture

Eugene

#5
Note:

Even in Express versions, it's possible to perform live edits of DLL code in Visual Studio debugger without having to restart WL6. The live edit ability starts working when a previously set Breakpoint has triggered.
profile picture

Eugene

#6
This convenient feature I referred to in post #5 is called Edit and Continue. Starting from VS 2013, E&C has been supported in 64-bit WL6.
This website uses cookies to improve your experience. We'll assume you're ok with that, but you can opt-out if you wish (Read more).