Will OCX need to be registered?

Jun 5, 2015 at 3:52 PM
I've been following your progress (great job so far) and thought that I understood that MW5 would be developed in such a way that an OCX would not be required (that is, the OCX would be recompiled into a managed or unmanaged DLL that could be deployed without registering the OCX).

However, when I read the tutorial it still talks about registering the OCX. Did I misunderstand this or was it just wishful thinking?

The problem of course is that Administrator privileges are required to register the OCX and that can be problematic. Also, having multiple versions of applications each needing different versions of the OCX is a problem.

I know that DotSpatial works this way, but it is not as mature as MW.

Thanks,

Chris Wilson
Coordinator
Aug 19, 2015 at 6:48 AM
Hi Chris,

Sorry for the late reply. Somehow Codeplex is not sending me emails with new posts anymore.
In this thread (https://mapwingis.codeplex.com/discussions/641520) Sergei answered a similar question, look at the last post.

If you are going to compile MW5 yourself you need to register the ocx else Visual Studio can't find it.
But if you want to install MW5 on an user computer you don't need to register it.

Currently we're working on the GIS Toolbox, after that we will make a first beta of MW5 with a set-up file and non-registered ocx.
If you can wait a few more weeks that would be the recommended.

Thanks,

Paul
Aug 21, 2015 at 7:38 PM
Paul:

Thanks for the feedback. I have tried that approach with mixed results in the past but will give it another try.

I have another "big picture" question though. I picture the OCX as basically a wrapper around the C++ MapWinGIS library. Why would you not instead just create a .Net DLL that can be consumed by .Net applications? Of course, that would limit you to .Net languages (you wouldn't be able to use Delphi, etc.), but the entire OCX architecture is dying so I don't know why you'd want to hang on.

If you are concerned about usability from non-.Net callers, you could publish a Windows DLL (compatible with all languages) and also a .Net DLL wrapper (which basically just decorates all the methods with parameter types, XML descriptions, etc.). Your existing OCX API documentation could probably be used with little modification. This approach would require the installation of two DLLs though (the Windows DLL and the .Net wrapper DLL) but that wouldn't be too bad. Alternatively, you could just include all the Windows DLL source code in the .Net DLL project and compile it (I don't know if the source code is language compatible with VS) or also embed the Windows DLL in the .Net DLL for extraction at runtime.

I'd love to discuss this with you further.

Chris
Oct 29, 2015 at 4:19 PM
Paul:

Has anyone given any thought to my last Aug 21 post?

Can you point out which source file might contain the reg-free code or discussion, or can you provide a simple tutorial on how to make that work?

Thanks,

Chris
Coordinator
Oct 29, 2015 at 9:26 PM
Hi Chris,

Several years ago some MW4 developers did what you suggested and made a .NET dll. It was called MapWindow 6 and is now called DotSpatial.

The benefits of a .NET-only approach are much smaller then the drawbacks. Drawbacks are mainly on speed, processing time and the size of datasets.
MapWinGIS is much faster, much more stable and can load much larger datasets.

The benefits of the OCX-approach are among others the ability to use the ocx in Excel, Access and Delphi. We have a lot of users that use it in this way.
Another reason we will not do your suggestion in the near future is that MapWinGIS.ocx is very stable, changing it will take time and will introduce bugs and problems.
We rather spend our limited time on the development of MW5.

You state the ocx architecture is dying. I understand Microsoft is reviving it and is using it a lot in Win10. Meanly because it is much faster and more stable than a .NET version.

In the current installers of MapWindow5 the ocx no longer needs to be registered and the installer can be installed without Admin privileges. So I don't see any reason to change this winning team.

Of course you can download the source code and change it as you like. It is all open-source.
Marked as answer by pmeems on 10/29/2015 at 2:27 PM