Immediate window VIsual studio debugging undefined - debugging

I am debugging a lot with visual code righ now and have problem with functionality called
immediate window. I used to use IntelliJ IDEA evaluation. I would like to evaluate AdjustWindowRect function with different parameters which is in
scope but when I typed in I am getting
#include <winuser.h>
unrecognized token
as implication of this I am getting for AdjustWindowRect
identifier "AdjustWindowRect" is undefined
Is even this functionality possible I mean declaring local variables and importing headers and calling functions in Visual Studio? Neither of them works for me. The only thing it works is locals variable which is defined.

Is even this functionality possible I mean declaring local variables
and importing headers and calling functions in Visual Studio?
As far as I know, immediate window will not catch variables, functions outside the current module by default which means that you cannot use it to obtain info outside the current debug page.
Since AdjustWindowRect function is from winuser.h(a extra head file), you cannot get it on immediate window. You can check this similar issue.
Or use IntelliJ IDEA from Resharper(third party extension) may realize it.
Besides, some workarounds are discussed here which you can try to check whether they do help.

Related

OpenModelica algorithmic debugger doesn't display variable values

I am struggling with debugging a model due to missing variable information in the Algorithmic Debugger's Local Browser window. As far as I understand the OpenModelica manuals, when setting a break point within an "algorithm" section and starting the debugger, all variables declared within the model's namespace should automatically show up in the Locals Browser.
Whichever of my own, but also the Modelica Std. Lib. example models I try, the Locals Browser window is always blank.
Is there a way of turning it on manually? Or do I need to add variables somehow manually? Or do I need to set any specific compile flags?
Thanks in advance for your time.
Stephan
Using: OpenModelica 1.17.0~dev-300-g00309fd on Ubuntu, with Modelica Lib. 3.2.3

Can I use FSI to debug my code?

Is there a way to run my .fs file with either a breakpoint or a command like System.Diagnostics.Debugger.Launch() in it so that I can use FSI to examine values, apply functions to them, plot them, etc.?
I know this question has been asked before but I tried the answers and could not make them work. Clear instructions or a link to a write-up explaining the process would be of great help not only to myself, but also, I believe, to all beginners.
Unfortunately, you cannot hit a breakpoint and jump into FSI. The context of a running .NET program is quite different to that of an interactive FSI session and they are not compatible enough to just switch between one or the other. I can understand an expectation of this kind of debugging when coming from other dynamic/interpreted languages such as JavaScript, Python etc. It is a really powerful feature.
As you have already noted, you can use the VS immediate window but you need to use its C#-like syntax and respect its limitations. Also, since it's not F#, you need to understand the F# to .NET conversion in order to make full use of it.
If you use Paket for dependency management in your project you have another option: Add generate_load_scripts: true to your paket.dependencies. This will give you a file like .paket\load\net452\main.group.fsx, which you can load into FSI to get all of the dependencies for your project. However, you are still responsible for loading in your own source files and building up some state similar to what is found at your desired breakpoint.
To hit a break point, in visual studio or visual studio code, you just click to the left of the line number you want to set your breakpoint. This is very much a supported feature in .fs files.

Visual Studio. Get all called function

Is there a way to get all function used in code.
Actualy I have a big dll which provides me an api of third-party system and now I need list of functions from this dll I'm using.
Is it possible? What way is better: macro or vs extension?
I guess, the API has a separate namespace. Unless you use explicit calls like: Third.party.namespace.ClassName.Method() you can remove using clauses and then filter somehow the errors the compiler shows you while rebuilding.
Or you can start by removing the references to the 3rd party assemblies, which will generate errors for all usings. Then you remove the using and then see every bit of code that relies on them. As I said unless there are explicit calls (which means there were some ambiguities) this should work.

Is it possible to have a warning when using a uninitialized variable

I don't know if it's a Javascript effect but I find myself trying to use uninitialized variable quite often when programming on the client side.
The C# compiler prevents you from doings things like that. Since TypeScript seems to have the contextual information necessary to do this kind of check I was wondering if there is a way to have warnings when trying to use a unitialized variable in the context of a class.
If you use strict mode in JS 'use strict' and declare your variables with the var keyword then I believe you will get warnings when your local scoped variables are undefined.
Also Visual Studio now gives you warnings for this I believe.
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Strict_mode

Why is IntelliSense in Visual Basic NOT showing the Methods/Variables present in Object during Coding?

Hi All,
I am new bie in Visual Basic scripting , I started using Visual Basic 2010 for scripting purpose.
Please find the attached screen shot, I have connected to the application using td connect object and after that I should be able to access all the functions from TD object.
Unfortunately VB IntelliSense is not displaying the included functions , I could not find the reason on why it is not displaying the functions in that object.
Please let me know where I am going wrong.
Regards,
Srihari
You are not specifying td as any type when you declare it. Therefore, without casting it to a specific type or declaring it as a specific type intellisense doesn't have any idea what is it except an object.
If you specify Option Strict On this will ensure you have identified the type for every variable or give you a compile-time error. This will allow intellisense to work properly.
Note: The OTA client uses Option Strict Off [dynamic in c#] for most of its objects, which will also cause you issues. You might want to specify Option Infer On

Resources