This is something I adapted for my own CiV mod development from my previous projects. In Civ 4 there was a modcomp which would create crash dumps when something went wrong, allowing for debugging of non-repeatable crashes in many instances. I've adapted the code for that and added it to the Gods & Kings DLL.
How to Use:
If you are doing DLL modding hopefully you will know what a crash dump is and how it is useful. The source changes are included in the download, and are all commented as part of the Minidump modcomp. To include this in your mod just merge the code with yours (it is quite localized), and compile. Then when the game crashes, it will create a crash dump named CvMiniDump.dmp in the same folder as the CiV EXE. To read the dump place it in the same folder as your custom DLL and it's debug database, and open it in Visual Studio. Then click the start debugging button and it will allow you to see what went wrong if it happened in the DLL.
Download
Credits:
terkhen, who originally wrote this for Civ 4.
How to Use:
If you are doing DLL modding hopefully you will know what a crash dump is and how it is useful. The source changes are included in the download, and are all commented as part of the Minidump modcomp. To include this in your mod just merge the code with yours (it is quite localized), and compile. Then when the game crashes, it will create a crash dump named CvMiniDump.dmp in the same folder as the CiV EXE. To read the dump place it in the same folder as your custom DLL and it's debug database, and open it in Visual Studio. Then click the start debugging button and it will allow you to see what went wrong if it happened in the DLL.
Download
Credits:
terkhen, who originally wrote this for Civ 4.