For simple .NET (VB/C#) functions, it is often sufficient during testing and debugging to display a small message using MsgBox():

using System.Windows.Forms;

public void ShowMsgBox(string text)
{
    MessageBox.Show(text);
}

Example call in GuiXT:

GuiXT


CallVB Utilities.TestClass.ShowMsgBox "Hello"

and the output on the screen will be

For more complex .NET (VB/C#) functions, it is useful to work with a debugger. The debugging tools of Visual Studio are available for this purpose.

To invoke the debugger, insert the "Stop" statement into your .NET (VB/C#) function:

using System.Diagnostics;

public void DebugMe()
{
    Debugger.Break();
}



Depending on the installed debugger, a window like the following will appear:

Select one of the available debuggers and confirm to open the debugger window, where you can inspect and modify values, step through the code, etc.:

Note: If you use a new version of the DLL file and want to overwrite the existing file, you must first close SAP GUI. Since no input is possible in debugging mode, use the Task Manager to find the SAP GUI process and terminate it.


Note: Instead of the "Stop" statement, you can also invoke the debugger via the Windows Task Manager (above) by selecting "Debug" for the saplogon.exe process and then dynamically set breakpoints in your .NET (VB/C#) code.