Windev 18 is a powerful development tool that allows you to create applications for Windows, Linux, Android, iOS, and more. One of the features of Windev 18 is the ability to save a memory dump of your application at any time. A memory dump is a detailed description of the elements in memory and the memory consumed by them. This can help you debug your application, optimize its performance, and detect memory leaks.
In this article, we will show you how to save a memory dump with Windev 18 using two methods: the dbgSaveMemoryDump function and the Ctrl + Pause shortcut.
Using the dbgSaveMemoryDump Function
The dbgSaveMemoryDump function is a WLanguage function that saves a memory dump of your application in a file or in interactive mode. You can use this function in your code or in the debugger. Here is the syntax of the function:
The parameter can be either a character string with the name of the file where the memory dump will be saved, or a question mark (?) to start the backup in interactive mode.
If you use a question mark (?), the behavior of the function depends on whether the dynamic audit is enabled or not. The dynamic audit is a feature that allows you to record all the events that occur during the execution of your application. You can enable or disable it with the dbgEnableAudit function.
If the dynamic audit is enabled, the memory dump will be saved in the dynamic audit file. If the dynamic audit is disabled, a file picker will allow you to select the name of the file where the memory dump will be saved. In both cases, a confirmation message will be displayed at the end of the operation.
You can also use some special elements in the name of the file, such as [%ExeDir%] for the directory of executable, [%ExeName%] for the name of executable without extension, [%Date%] for the current date, and [%Time%] for the current time. For example:
This will save a memory dump with a name like \\\"MyApp_2023-04-23_07-35-47.dmp\\\" in the same directory as your executable.
Using the Ctrl + Pause Shortcut
An alternative way to save a memory dump with Windev 18 is to use the Ctrl + Pause shortcut on your keyboard. This will trigger the same behavior as using dbgSaveMemoryDump(?) in your code. That is, it will save the memory dump in the dynamic audit file if it is enabled, or ask you to choose a file name if it is disabled.
This shortcut works at any time during the execution of your application, even if you are not in debug mode. However, it may not work if your application uses some keyboard hooks or intercepts some system messages.
Saving a memory dump with Windev 18 can be very useful for debugging and optimizing your applications. You can use either the dbgSaveMemoryDump function or the Ctrl + Pause shortcut to do so. The memory dump file can then be opened with tools like WinDbg or Visual Studio to analyze its content and find potential issues.
We hope this article has helped you learn how to save a memory dump with Windev 18. If you have any questions or feedback, please leave a comment below. 29c81ba772