Log In    |    Knowledge Base    |    4D Home
Tech Tip: Debugging a Plug-in using Codewarrior
Published On: July 27, 2001

There will be times when your plug-in will not perform correctly. In these cases you may need to debug the plug-in to see what is happening behind the scenes. To do so with Visual C++ go to the Project menu and select "Settings". This will open the Project Setting dialog. In this dialog you will want to click on the Debug tab. Under "Executable for debug session" click on the right arrow next to the enterable area and then "Browse". Here you want to select the copy of 4D you are currently using to run your database. Next we want to set a breakpoint. A breakpoint will cause the currently executing code to stop. Breakpoints in C++ are very similar to breakpoints in 4D. To set a breakpoint simply right click on a line and from the menu choose "Insert/Remove Breakpoint". Once you have done this go to the Build menu and choose "Start Debug" then "Go". This will launch 4D. Simply run your code and when a breakpoint in your plug-in is reached the Debugger window will appear similar to what is below.

Inside the Visual C++ debugger you can view the current flow of code along with the current values of all the variables in the "Variables pane" in the lower left corner of the dialog. To learn more about the Visual C++ debugger take a look at the User Manuals for Visual C++.