MapWinGIS error when working with Delphi

The new version has a fix - [MWGIS-205] - GdiplusStartup/Shutdown should not be called in DllMain… Without which, when working with Delphi, the application could not in some cases complete its work normally and hung up. In particular, I for example could not use the DevExpress package. Now everything is fixed, it works normally. However! It works fine, now only if you use the DevExpress package, which implements its own work with GdiPlus, if we run the application with standard components, ZoomBar, RedrawTime, VersionNumber are not displayed. Who made this fix can check it out. I’ve checked this several times. Maybe something else isn’t working right. This is the first thing that caught my eye.


While I have to roll back to the old version

Hello Valeriy,

Just to let you know, I loaded up a clean test app with the most recent build, and I am seeing some of the behavior you mention here. I will step through to see what’s going on.


Ok. I will wait for good news.

Ok. I found the problem.

In my test application, the only control I added to the form was the map control, and it had the problem. As soon as I added any other standard control to the form (in the Visual Studio world), the problem went away. So in many applications, you would not see the problem, and that’s why it went undiscovered. I’m glad you discovered this.

The GDI Brushes and Pens used to draw the Zoombar, Scalebar, etc., were defined as stack-based (non-pointer) variables in the map, and initialized in the constructor BEFORE GdiplusStartup was called, and thus their initialization was failing. Of course, the code worked in prior versions of the map since Gdiplus was started at DLL load-time, before the map was constructed.

I changed the variables to pointers, and initialized them after initial construction of the map, and that resolved the problem. I just need to write up a Jira ticket and submit the changes.

Thanks again.

Ok. Thanks, Jerry. I will wait for corrections.

FYI, changes have been submitted and documented in Jira ticket MWGIS-228.