latest (61471) OCX registration issue

Jun 20, 2011 at 1:14 PM

Hi all,

downloaded the source code (61471), compiled OK, registered OK. Created C# solution, added ocx control to the solution OK, added control on a form OK, but during compilation got the error in Form Designer class line No. 53 (see below)

the error was "Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG))"

Could somebody advise, Am I doing something wrong or this is  ocx issue? The same thing I did two weeks ago with older version and it did work fine

Thank you in advance!


44            //
45            // Form1
46            //
47            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
48            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
49            this.ClientSize = new System.Drawing.Size(292, 273);
50            this.Controls.Add(this.axMap1);
51            this.Name = "Form1";
52            this.Text = "Form1";
53            ((System.ComponentModel.ISupportInitialize)(this.axMap1)).EndInit();
54            this.ResumeLayout(false);
56        }

Jun 21, 2011 at 12:00 PM

Did you also create new interop dlls?

Several changes have been made that require that.


Jun 21, 2011 at 12:53 PM

Yes, I did.   If add new component from file on a Visual Studio Toolbox panel and then add this component on a form in VS project then all interops will be generated automatically.

Jun 22, 2011 at 3:42 PM

Do you also have all the necessary dependencies in your bin folder?

You need at least IndexSearching, gdal, geos, proj4.

I've just created a new installer for the second Release candidate. It's available on the download page.
Can you try to install that version and see if that helps?



Jul 12, 2011 at 10:00 AM


Yes I have all dependencies in my bin folder.

I tried to do the same things on WindowsXP 32bit and it worked fine! perhaps it is feature of my windows XP 64 bit PC. I still have the same issue on 64bit PC.



Jul 14, 2011 at 4:11 PM
Edited Jul 15, 2011 at 7:34 PM

OS: Win 7 - 64bit
Development Environment: Visual Studio 2008 Pro
Prog Language: 


I'm experiencing the same as Igor: Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)).

About 3 weeks ago, I was able to work on an existing .Net application with a map on the form and it would compile and ran fine.  I switched back to developing in C++/MFC for a similar project, and it was able to 

 I've uninstalled and re-installed the latest (4.8.3) MapWinGIS.  The weird thing is that it appears to work under Visual Studio 2010 in a .Net (C#) Window Forms application.

Reference the line: ((System.ComponentModel.ISupportInitialize)(this.axMap1)).EndInit();

I noticed that if I hovered over "this.axMap1" and clicked the "+", I saw all the sub classes have the error:

'this.axMap1.CanUseImageGrouping' threw an exception of type 'System.Window.Forms.AxHost.InvalidActiveXStateException'

and the same error occurs for each of the members from the "this.axMap1" object.

Could there be a problem with the Visual Studio 2008, but not influencing Visual 2010?

Any help would be GREATLY appreciated...



I found an article online about that HRESULT: 0x80040154 and it indicated that the error occurs because of the Project properties - the CPU should be set to a specific type (x86, for example), instead of "Any CPU".  Once I changed the setting, the program ran fine.

I'm still perplexed, as my home PC is running fine with the "Any CPU" setting still in place, but I was unable to get it to run with my work computer. 

Interestingly, though, I tried adding a different ActiveX component to a blank/new forms application, and it did the same thing.  I suspect that something got screwed up in my GAC, but it's only a speculation.


Jul 18, 2011 at 7:19 AM

Thanks for the update.

We compile all binaries for x86 or x64 specifically because of the C++ parts.
A possible explanation why your work computer is giving trouble might because that pc has a 64-bit CPU and/or a 64-Bit Windows version.


Sep 1, 2011 at 8:45 PM

I am getting this same error when using VS 2008 C# express. Being the express version it does not allow me to change CPU types. I'm working on a Windows 7 64-bit machine. Anyone have any solutions for this issue?