MapWindow 4 - Plugins : MapWindow Discussion Forum
Hi All, I am very new to Map window development.I was trying to develop some custom application using mapwindow legend control and mapcontrol. In my application I had a "Add data button" while clicking on this button a dilogue box will open where user can select shape file
Issue with the legend control
Date: April 10, 2012 03:09AM

Hi All,

I am very new to Map window development.I was trying to develop some custom application using mapwindow legend control and mapcontrol. In my application I had a "Add data button" while clicking on this button a dilogue box will open where user can select shape file and then can add to the legend.After adding the data from the "add data" button it is throwing the Missing Method exception with the following message.

"Method not found: 'Boolean MapWinGIS.IShapeDrawingOptions.DrawRectangle(IntPtr, Single, Single, Int32, Int32, Boolean, Int32, Int32, UInt32)'".

In the add data button click event I wrote the following code:

OpenFileDialog openFileDialog1 = new OpenFileDialog();
openFileDialog1.Filter = "shapefile|*.shp";
openFileDialog1.Title = "Select a shape File";

int handle;
if (openFileDialog1.ShowDialog() == DialogResult.OK)
{
MapWinGIS.Shapefile shp = new MapWinGIS.Shapefile();
shp.Open(openFileDialog1.FileName, null);
handle = legend1.Layers.Add(shp,true);
legend1.Map.set_LayerName(handle,System.IO.Path.GetFileNameWithoutExtension(shp.Filename));

}



and in the form initialization I added the following code.



public Form1()
{
InitializeComponent();

//**Initialize the legend control**//
legend1.Map = (MapWinGIS.Map)axMap1.GetOcx();
}


I would like to let you know that I am using VS2008 with .net frame work 3.5.


Any help concerning this will be highly appreciated. Thank you for your time.

Regards,
Niladri
GIS-Developer
India

Options: ReplyQuote
Re: Issue with the legend control
Posted by: pmeems ()
Date: April 10, 2012 04:16AM

It looks like your missing some references.
You are referencing axmap.interop.dll and mapwingis.interop.dll?

--
Paul

--
Don't forget to read the new documentation: www.mapwindow.org/documentation/mapwingis4.8
Join us Google+: MapWindow GIS Google+ Community
Join the MapWindow Group on LinkedIn! LinkedIn - MapWindow Group

Download the latest beta installer at:
tinyurl.com/mwMonthly 32-Bit
tinyurl.com/mwMonthlyx64 64-Bit
Follow me on Twitter MapWindow_nl to read when a new installer is published.

---
Paul Meems
The Netherlands
[www.bontepaarden.nl]
Release manager, configuration manager and
forum moderator of MapWindow GIS

Owner of MapWindow.nl - Support for
Dutch speaking users: www.mapwindow.nl

*******
Everything I say or write is my personal opinion and
not the opinion of the company I work for.
*******
View my profile on LinkedIn

Options: ReplyQuote
Re: Issue with the legend control
Date: April 10, 2012 04:26AM

Hi Paul,

Thank you for your reply. Yes in the reference I am using these following dlls

1.AxMapWinGIS(AxInterop.MapWinGIS.dll)

2.MapWinGIS(Interop.MapWinGIS.dll)

3.MapWinInterfaces(MapWinInterfaces.dll)

Regards,
Niladri

Options: ReplyQuote
Re: Issue with the legend control
Date: April 11, 2012 03:49AM

Hi Paul,

Is there any update regarding this issue? I got stuck in this point and really need help. For your reference I have attached the screen shot of the issue.

Looking forward for your response.Thanks for your time.

Regards,
Niladri

Attachments: missing method exception was unhandled..JPG (128.7 KB)  
Options: ReplyQuote
Re: Issue with the legend control
Date: April 11, 2012 06:28AM

Hi Paul,

I would like to let you know that I resolved the issue. This issue was due to the MapWinInterfaces(MapWinInterfaces.dll).It was some how corrupted. I re register the dll and It works like a charm!!!. Thank you for all of your time.

Regards,

Niladri

Options: ReplyQuote
Re: Issue with the legend control
Posted by: pmeems ()
Date: April 11, 2012 07:14AM

Thanks for letting us know.

--
Paul

--
Don't forget to read the new documentation: www.mapwindow.org/documentation/mapwingis4.8
Join us Google+: MapWindow GIS Google+ Community
Join the MapWindow Group on LinkedIn! LinkedIn - MapWindow Group

Download the latest beta installer at:
tinyurl.com/mwMonthly 32-Bit
tinyurl.com/mwMonthlyx64 64-Bit
Follow me on Twitter MapWindow_nl to read when a new installer is published.

---
Paul Meems
The Netherlands
[www.bontepaarden.nl]
Release manager, configuration manager and
forum moderator of MapWindow GIS

Owner of MapWindow.nl - Support for
Dutch speaking users: www.mapwindow.nl

*******
Everything I say or write is my personal opinion and
not the opinion of the company I work for.
*******
View my profile on LinkedIn

Options: ReplyQuote


Sorry, only registered users may post in this forum.





Banner Exchange




GISCP.com




Send us your banner logo (160x120) for the space above, and add this MapWindow banner ad to your site:

Just paste this text in your page: