• We have updated our Community Code of Conduct. Please read through the new rules for the forum that are an integral part of Paradox Interactive’s User Agreement.
Thanks for this, I suppose that doing these stockpile limits will be really easy.

This week, I want to lay my hands on this total IC calculation and will see really how difficult it is ;)
 
Whoa, it took me some time but it's the matter of digging into code that I already forgot a bit and introducing brand new things, not only fixing minor issues. And the last few days were so crazy that I had the new version compiled but didn't have time to post it :)

Anyway, you may look how well does it behave. IC calculation may not be 100% accurate (there's plenty of factors that influence it) but it should be closer to reality. And now it should be much easier to introduce smaller changes.

http://codeofwar.tk/index.php/component/content/article/9-apps/9-dh-companion
 
Hello,

first of all, thanks for the awesome work!

I know the program is fairly old (sorry for ressurecting this thread) but maybe someone can help me anyway :)

I am playing darkest hour with wine under linux. Therefor I'm running the DH companion under linux, too.

But I have one problem. The statistics tab works perfectly, but the map tab throws an exception right after startup of the application.

I ran the application on a windows installation and everything worked perfectly out of the box. So the problem has to do something with wine or missing libraries.

I am using a 32bit wineprefix (version wine-1.8.5 (Ubuntu 1.8.5-1ubuntu2)) and have installed net framework 4.0. But besides this I haven't installed other libraries.

Maybe you have an idea what goes wrong there. Following is a screenshot right after startup and a copy of the exception text you see in the screenshot.

I hope there is simply a library missing.

scrot_2017-06-20_19-33-02_screenshot.png


Code:
See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.ArgumentException: Parameter is not valid.
   at System.Drawing.Graphics.CheckErrorStatus(Int32 status)
   at System.Drawing.Graphics.FillPolygon(Brush brush, Point[] points, FillMode fillMode)
   at System.Drawing.Graphics.FillPolygon(Brush brush, Point[] points)
   at DHC.Polygon.Draw(Graphics g, Pen p, Color[] provinceColors, DataMode mode)
   at DHC.Map.Draw(Graphics g, DataMode mode, Int32 currentProvinceID, Rectangle region, Matrix matrix, Int32 lod)
   at DHC.Map.Draw(Graphics g, DataMode mode, Int32 currentProvinceID)
   at DHC.MainWindow.panelMap_Paint(Object sender, PaintEventArgs e)
   at System.Windows.Forms.Control.OnPaint(PaintEventArgs e)
   at System.Windows.Forms.Control.PaintWithErrorHandling(PaintEventArgs e, Int16 layer)
   at System.Windows.Forms.Control.WmPaint(Message& m)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)


************** Loaded Assemblies **************
mscorlib
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.1 (RTMRel.030319-0100)
    CodeBase: file:///C:/windows/Microsoft.NET/Framework/v4.0.30319/mscorlib.dll
----------------------------------------
Darkest Hour Companion
    Assembly Version: 1.3.1.0
    Win32 Version: 1.3.1.0
    CodeBase: file:///Z:/home/<username>/dokumente/manuals/Darkest_Hour/dhc_14/Darkest%20Hour%20Companion.exe
----------------------------------------
System.Windows.Forms
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.1 built by: RTMRel
    CodeBase: file:///C:/windows/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.1 built by: RTMRel
    CodeBase: file:///C:/windows/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Drawing
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.1 built by: RTMRel
    CodeBase: file:///C:/windows/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
DHC.Database
    Assembly Version: 1.0.0.0
    Win32 Version: 1.0.0.0
    CodeBase: file:///Z:/home/<username>/dokumente/manuals/Darkest_Hour/dhc_14/DHC.Database.DLL
----------------------------------------
DHC.Settings
    Assembly Version: 1.0.0.0
    Win32 Version: 1.0.0.0
    CodeBase: file:///Z:/home/<username>/dokumente/manuals/Darkest_Hour/dhc_14/DHC.Settings.DLL
----------------------------------------
DHC.Definitions
    Assembly Version: 1.0.0.0
    Win32 Version: 1.0.0.0
    CodeBase: file:///Z:/home/<username>/dokumente/manuals/Darkest_Hour/dhc_14/DHC.Definitions.DLL
----------------------------------------
Accessibility
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.1 built by: RTMRel
    CodeBase: file:///C:/windows/Microsoft.Net/assembly/GAC_MSIL/Accessibility/v4.0_4.0.0.0__b03f5f7f11d50a3a/Accessibility.dll
----------------------------------------
System.Xml
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.1 built by: RTMRel
    CodeBase: file:///C:/windows/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
System.Core
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.1 built by: RTMRel
    CodeBase: file:///C:/windows/Microsoft.Net/assembly/GAC_MSIL/System.Core/v4.0_4.0.0.0__b77a5c561934e089/System.Core.dll
----------------------------------------
DHC.CommonInterface
    Assembly Version: 1.0.0.0
    Win32 Version: 1.0.0.0
    CodeBase: file:///Z:/home/<username>/dokumente/manuals/Darkest_Hour/dhc_14/DHC.CommonInterface.DLL
----------------------------------------
ICSharpCode.SharpZipLib
    Assembly Version: 0.86.0.518
    Win32 Version: 0.86.0.518
    CodeBase: file:///Z:/home/<username>/dokumente/manuals/Darkest_Hour/dhc_14/ICSharpCode.SharpZipLib.DLL
----------------------------------------

************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.

For example:

<configuration>
    <system.windows.forms jitDebugging="true" />
</configuration>

When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box.
 
Hello!

Yeah, that's quite a blast from the past, going again through this code written ages ago :)

I don't have any good news to bring however. The exception text points at "System.Drawing.Graphics.FillPolygon" method where I can't find any obvious culprits. It really takes only two arguments, brush definition to specify fill color and array of points to define the polygon shape. Unlike my later programs that get significantly more data dynamically, DH Companion is more self-contained and there is less problems that may happen with external data. MSDN doesn't even mention ArgumentException possible for this method so there is probably something wrong INSIDE the drawing routines, probably not linked to program data (if there was ArgumentNullException, I would presume that something goes wrong at earlier stage and already wrong - null data is sent to the method).

GDI+ is very basic component of .NET (System.Drawing.dll to be precise) so there's no external library that could save you there. I have no real experience with WINE but if there are any compatibility settings for GDI+ (that are the graphics routines that the program uses, no DirectX, no WPF or any fancy stuff), you may try that. Good luck!
 
"I'd like to use this opportunity to thank Lucifer"

Excuse me for indulging in this post, but I just read the first post and had a vigorous laugh at that.
_____
Bonus for being the 69th post.
 
:D
That’s understandable

"I'd like to use this opportunity to thank Lucifer"

Excuse me for indulging in this post, but I just read the first post and had a vigorous laugh at that.
_____
Bonus for being the 69th post.
 
Le lien est mort ? Je ne télécharge pas le compagnon

Thanks for resurrecting this thread. I didn't know that this program exists or rather existed, the links are dead.

Has anybody the latest version and could provide a download link for it? Or pass it on to me, then I can try to setup a download?
 
  • 1Like
Reactions:
Has anybody the latest version and could provide a download link for it? Or pass it on to me, then I can try to setup a download?
Sorry, I made some cleanups on the server and forgot that this file was linked here. It's restored so the link should work.

Also, the file is available here: https://onedrive.live.com/redir?resid=A80A324886980C06!77096

Seems that latest link is still working (tested today) but I'm unable to download single file. I need to download whole folder and this way there's no problem.


1660299051552.png
 
  • 2Like
  • 1
Reactions:
Seems that latest link is still working (tested today) but I'm unable to download single file. I need to download whole folder and this way there's no problem.

Thanks. It took me several tries but somehow it worked then.

Just to make it a bit easier, here a direct link to an alternate download:
Darkest Hour Companion 1.4 (dhc_14.7z, 2.6 MB)

I am not the author, so no guarantees. Above should be the most uptodate version 1.4, repacked to the 7z-format.
 
  • 3Like
Reactions:
Hello!

Yeah, that's quite a blast from the past, going again through this code written ages ago :)

I don't have any good news to bring however. The exception text points at "System.Drawing.Graphics.FillPolygon" method where I can't find any obvious culprits. It really takes only two arguments, brush definition to specify fill color and array of points to define the polygon shape. Unlike my later programs that get significantly more data dynamically, DH Companion is more self-contained and there is less problems that may happen with external data. MSDN doesn't even mention ArgumentException possible for this method so there is probably something wrong INSIDE the drawing routines, probably not linked to program data (if there was ArgumentNullException, I would presume that something goes wrong at earlier stage and already wrong - null data is sent to the method).

GDI+ is very basic component of .NET (System.Drawing.dll to be precise) so there's no external library that could save you there. I have no real experience with WINE but if there are any compatibility settings for GDI+ (that are the graphics routines that the program uses, no DirectX, no WPF or any fancy stuff), you may try that. Good luck!
Hello. I got this error and spent 20 hours in a row to fix it. I had to learn c# so it was a slow process. But it worked

when it worked I made many copies on many drives and clouds, I was so happy.

I then downloaded the program anew and pulled the exe over to one of the fixed folders.
It still worked.

It no longer works though, none of the copies of the fixed version work

So I checked md5 checksum on all the files from before and after fix.

It was the same.

I was baffled so I did sha 512

still same.
I probably got so excited and was so tired that I overwrote the fix with the original, packaged it up 10 times and clouded it

But I did it in an evening and a night and a day starting from scratch it can't be that hard

I used the debugging method I was told to use and started doing hello world in c#
 
  • 1
Reactions: