Cannot add MapControl to WinForms in VS2022

Hi,

I’m trying to create a new project in VS 2022 using .NET WinForms where I tried to download the 32 bit version of the MapWinGIS and tried to add the Map Control OCX as COM Components in toolbox>coose Items.

It is showing this error as attached.
I tried registering this ocx via regsvr32 but still the error remains.
Please suggest.

Thanks,
Shadab

Hi Shadab,

I had the same problem when I installed it. VISUAL Studio 2022 has moved to being a 64-bit application, so I I believe that’s why I think you need to work with the 64-bit version. That’s what I had to do (I used to work with both) .

Regards,

Rob H

Hi Rob,

You’re right. I was bit apprehensive about the 64 bit as the above note in the MapWinGIS mentions that the 32 bit ocx is required.
However, I’m still worried in terms of VS 2022 and its stability. Also if I make a installer out of the 64 bit ocx, not sure how stable the application would be.

Thanks,
Shadab

Hi Shadab,

Before VS 2022, I always used both 32-bit and 64-bit .ocx files - but my colleague has always used 64-bit only it seems, with no problems (which I was surprised about - I thought you needed 32-bit for the designer pre VS 2022).

Personally, with just the 64-bit installed I am having fewer problems in the VS IDE than I used to and have not had any specific problems that I can remember other than an issue with a reference to stdole.

Is your application currently 32-bit then (mine is 64-bit)? When you say “make an installer” - do you mean of MapWinGIS as there already is one?

Regards,

Rob

Hi Rob,

I tried the 32 bit ocx initially with frequent crashes for past one month. For past two days the 32 bit was showing the error as posted first. Even though I tried with a new project, same error. Later realized that the VS 2022 toolbox is greyed out. Had to re-install the VS 2022 to make it work.

After the post I tried with the 64 bit ocx in VS 2022 and surprisingly, it hasn’t crashed so far. However, the performance of loading close to 10K polygons is not as snappy as the QGIS.

The application I’m building now is 64 bit. The installer is about the custom WinForm app I’m building which is a desktop tool with a map viewer to load some spatial data and perform some custom workflows. I tried other map viewers like EGIS, Tatuk etc. The stable one so far appears to be MapWinGIS Viewer 64 bit. I’m hoping this remains stable in time to come.

Thanks,
Shadab