First, go to Panzer General 2's folder and try launching PANZER2.EXE and, if that doesn't work, PG2UK220.exe directly.
If that doesn't help, delete the d3dx9_42.dll file. Then download and install the June 2010 DirectX runtime package. Some older games aren't compatible with the libraries included with current releases of DirectX and this package should help.
You will have to extract the files into a selected folder, then open that folder and launch the DXSETUP.exe file in order to proceed with the installation. Now try launching PANZER2.EXE and PG2UK220.exe.