Hi there
I am new in the field. I have been assigned a task to troubleshoot a legacy tool, failing to load in MapInfo 15.0.
This tool was working properly with MapInfo 12.0 but not any more.
Uses menus instead of Ribbon. My suspicion is there is some additional initialisation that needs to be added to the .mb file but his is only guessing as the tool has been developed by someone else and my experience in writing plugins is limited.
The code called when the one menu item which loads the tool is clicked is trying to register a UserControl to a dock window. It succeeds but any attempt to access the resulting window, as in setting dock state, docking, floating or even setting the window title throws a NullReferenceException.
This is a cut down version of the code in the static method of the Controller:class
_miApp = InteropServices.MapInfoApplication
_layerControlDlg = New TableManagerControl(New Controller())
_dockWindow = _miApp.RegisterDockWindow(_layerControlDlg.Handle)
The code succeeds, _dockWindow is not null but apparently some COM stuff is not initialised as anytime anyone attempts to access or use _dockWindow in any way there is a NullReferenceException coming from the interop.
I even tried to use a dummy, empty user control instead of TableManagerControl to make sure it's not something the TableManagerControl is causing, no luck, same issues.
As I said the concept of calling a static method from the menu may be the issue, but It's really a guess...
Any insight would be very much appreciated
Thanks
Kostas Christodoulou
------------------------------
Kostas Christodoulou
Knowledge Community Shared Account
------------------------------