Get Error when drag Gmap Component to Winform

Jul 20, 2009 at 2:44 AM

Hi folks,

When I drag GmapControl component to my window form, I get Error message, because in this discussion seem not for insert image, show I describe as follows:

Failed to create component 'GMapControl'. The error message follows:

'System.NullReferenceExcaption: Object reference not set to an instance of an object.

at GMap.Net.Internals.Core.UpdateGroundResolution()

at GMap.Net.Internals.Core.UpdateBaunds()

at GMap.Net.Internals.Core.ReloadMap()

at GMap.Net.Internals.Core.StartSystem()

at System.Windows.Forms.GMapControl.OnLoad(EventArgs e)

at System.Windows.Forms.UserControl.OnCreateControl()

at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)

at System.Windows.Forms.Control.CreateControl()

at System.Windows.Forms.Control.ControlCollection.Add(Control value)

at System.Windows.Forms.Form.ControlCollection.Add(Control value)

at System.Windows.Forms.Design.ParentControlDesigner.AddChildControl(Control newChild)

at System.Windows.Forms.Design.ParentControlDesigner.AddControl(Control newChild, IDictionary defaultValues)

at System.Windows.Forms.Design.ControlDesignerInitializeNewComponent(IDictionary defaultvalue)

at System.Drawing.Design.ToolboxItem.CreateCompone...'

Anyone can help me?


Thanks and Best regards,


Jul 20, 2009 at 7:37 AM

I don't think I quite understood the problem but from what I see, I think you just have to avoid the calling of the Core.StartSystem() method while in designer mode which is why in the earlier builds of the GMap Library you could see a if(!DesignMode) right in the control constructor.

Hope this helps.


Jul 20, 2009 at 8:44 AM

yes, but thats new WPF version, i have just added some check, does it work correct now?

Jul 20, 2009 at 8:48 AM


Because, I don't use WPF version.

Thanks and best regards,


Jul 20, 2009 at 9:21 AM

should be ok now

p.s. i have no idea why thats not working for OnSizeChanged ;/

Jul 20, 2009 at 9:46 AM


I will check by update TortoiseSVN.

Thanks and Best regards,


Jul 20, 2009 at 10:06 AM

Hi folks,

I check in my window form, It work OK, when I adding control from toolbox in GMap.NET.WindowsForms.

Thanks and Best regards,