The DLL doesn't contain human-readable code, you'll need to edit the .cpp and .h source files in the CvGameCoreDLL folder and then use the Visual C++ compiler to create a new DLL file from the modified source code. In the case of fail gold, CvCity.cpp is the file to edit, specifically the function
CvCity::doCheckProduction. Although fail gold can actually also be disabled or dialed down through XML: MAXED_BUILDING_GOLD_PERCENT in GlobalDefines.xml. There's also iTradeModifier in Civ4YieldInfos.xml (XML\Terrain folder of the base game), which gets stored (cached) by CvPlayer in
CvPlayer::init and then gets loaded from CvPlayer by
CvCity::calculateTradeYield. Looks like this system could be used to e.g. convert half of the "trade profit" normally paid out as commerce into hammers (production) instead. Probably not going to work well due to rounding losses; but, through a DLL change (i.e. to CvCity.cpp), you could let calculateTradeYield determine the amount of production and food in any way you choose.
Leoreth's thread is still current, and my suggestion would be to ask for any needed clarifications in that thread. I wouldn't call it foolproof, but, at least for my part, I don't want to write something new that I'd then have to keep updated. I'm also not sure that modders agree what IDE (e.g. Visual Studio) and libraries should be used. Imo, for beginners, VS2010 (second link in Leo's thread) is still the best way to go - though I haven't tried using it under Win11 or on a very large display. I think the installer asks whether to install for C++ or C#; the correct choice will be C++. The third link is for the Windows SDK and MSVC toolkit; should also be fine. That'll be version 7.0A of the Win SDK, apparently. Perhaps version 6.0 is more proper, but, at least so long as VS2010 is used, it shouldn't make a difference. Generally, those files, especially the compiler itself (included in the MSVC toolkit) need to be old enough to be fully compatible with the tools that Firaxis used for compiling the EXE (Civ4BeyondSword.exe). Any DLL we compile needs to interact with the old EXE (which we can't recompile because we lack the source code). Step 3 – obtaining the DLL source code, makefile and project files (.vcxproj and .sln) and editing the paths in the makefile – should work as described. That's the difficult part. To compile, the sln file should be opened with Visual Studio. VS can (and probably should) also be used for editing the source code, but any text editor could be used too. For editing in VS, the desired file can be opened via the Solution Explorer window.
If you want to use another DLL mod, e.g. BULL, as the basis of your own mod, then you'll need to obtain the C++ sources (CvGameCoreDLL folder) of that mod, or at least those .h and .cpp files that the mod has modified. Though it might still be a good idea to recompile just the original source code to get started.