This project is read-only.

Cannot add MapWinGIS to toolbox in VS 2010

Mar 11, 2012 at 3:48 PM

Hopefully, I am just missing something very easy, but my problem is that I can't see MapWinGIS.ocx (Map Control) in the COM Components when I Choose Toolbox Items to add to the Toolbox (in MS Visual Studio 2010).  I am using Windows-7 64-bit, and I was able to successfully register the OCX file using regsvr32.  However, the OCX simply isn't appearing as an option under Choose Items.  I'm not really sure what else I need to do for this to show up - the documentation suggests that it should appear automatically after the file is registered.

I would appreciate any advice or assistance. 

Simeon

Mar 11, 2012 at 9:02 PM

I belive that, once registered you open up VS2010, get a form open, select the tool bar, right click in whichever group you wish to add the control to, select Browse, browse to the OCX, selected and off you go....  Well that's how I did it!

Mar 12, 2012 at 9:08 AM

Hmmm.  Ok, when I use Browse and manually select the OCX, I get an error saying that "self-registration ... failed" (even though I have already registered it with regsvr32).  I am running VS2010 as Administrator.  

This really looks like some sort of Windows permissions issue, but I'm really baffled as to what I need to change in order for it to work. 

Mar 12, 2012 at 9:53 AM

I've got exactly the same problem than you slkrr. I'm on windows seven 64 bit and using visual studio express 2010. The mapcontrol doesn't appear in the list of COM components, but mapwingis appears in the list of references!

Mar 12, 2012 at 9:59 AM

There are 2 regsvr32 programmes! one in System32 the other in SysWOW64.  Depending on whether you are 64 bit or 32 bit depends on which one you use.  I honestly can remember, I just mucked about till it worked!  It is supposed to work from the install and there is a script in there.  If you remove the -s int regserver32 command it will display any errors in registration.  This script also removes the registration before registering a new instance.  This is documented 'somewhere' in a readme or similar file.

Mar 12, 2012 at 12:12 PM

Yes, I used the regsvr32 in the SysWOW64 directory and ran it from the Administrator Command Prompt.  This part worked fine, and it did put entries into the registry.  

The problem is that it doesn't show up in VS2010 in the Choose Toolbox Items list, and if i Browse for it, it gives me the "self-registration" error.  I'm not really sure if this is a permissions issue or a compatibility issue, or what.  

Are there other DLLs that need to be registered manually?

Mar 12, 2012 at 1:23 PM

The same thing also happens with VS2008.

Mar 12, 2012 at 5:01 PM

The problem is that Vis. Studio cannot handle 64-bit com objects.

To get the ocx in Vis. Studio you need to install the 32-bit version of the ocx as well.
You can however build for x64 and create a 64-bit only application with the ocx, but during design time you need the 32-bit version.

Mar 12, 2012 at 5:08 PM
thanks!


From: [email removed]
To: [email removed]
Date: Mon, 12 Mar 2012 09:01:41 -0700
Subject: Re: Cannot add MapWinGIS to toolbox in VS 2010 [mapwingis:348168]

From: pmeems
The problem is that Vis. Studio cannot handle 64-bit com objects.
To get the ocx in Vis. Studio you need to install the 32-bit version of the ocx as well.
You can however build for x64 and create a 64-bit only application with the ocx, but during design time you need the 32-bit version.
Read the full discussion online.
To add a post to this discussion, reply to this email (mapwingis@discussions.codeplex.com)
To start a new discussion for this project, email mapwingis@discussions.codeplex.com
You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe or change your settings on codePlex.com.
Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at codeplex.com
Mar 13, 2012 at 9:36 AM

Thanks pmeems!  That seems to have been the problem.  It is working now!

Dec 24, 2012 at 9:16 AM

I installed the 32 bit version and I still get the same error. No soup for me.

Dec 24, 2012 at 9:19 AM

Hmm computer reboot and now it worked. Soup is good food.