Hi,
I'm not sure what Group the question belongs to
I'm building a Windows.Forms application, having a Mappoint control.
At the time a map file is opened with OpenMap I'm getting the error (in the
subject).
the error code (as COM Exception) : 800a400b
It used to work fine in MP-2002.
I can't open any ptm file - even a file provided in MP/Samples
My build details are as follows:
As part of the installation I've fot MappointControl.ocx - version
11.00.18.1900
and registered it (checked the registry - both CLSID and TLB entries are
there, correct version and Server paths)
I ran AxImp, building MapPint.dll and AxMapPoint.dll
With these files in my Projest's References, I can build successfully
(without those References - was getting an error, complainig unresolved
namespaces)
Both DLLs were copied to the destination folder of the build
What is a possible cause of this behavior?
=====================================================
FYI: the code I'm executing is as follows:
private AxMapPoint.AxMappointControl m_mapCtrl;
private Map m_map;
................................
... In the Constructor (of my UserControl-derived class)
this.m_mapCtrl = new AxMapPoint.AxMappointControl();
((System.ComponentModel.ISupportI
nitialize)(this.m_mapCtrl)).BeginInit();
this.SuspendLayout();
this.m_mapCtrl.Enabled = true;
this.m_mapCtrl.Location = new System.Drawing.Point(0, 0);
this.m_mapCtrl.Name = "m_mapCtrl";
this.m_mapCtrl.Size = new System.Drawing.Size(800, 376);
this.m_mapCtrl.TabIndex = 0;
this.Controls.Add(this.m_mapCtrl);
((System.ComponentModel.ISupportInitialize)(this.m_mapCtrl)).EndInit();
this.ResumeLayout(false);
.... in the _Load
m_map = m_mapCtrl.OpenMap("C:\\Program Files\\Microsoft
MapPoint\\Samples\\Typical US Marketing Areas by 3 Digit ZIP Code.ptm");
and this line throws an exception
Message: The file you choose is not a MapPoint 2004 2004 file
StackTrace "
at MapPoint.IMappointCtrl.OpenMap(String FileName)\r\n
at AxMapPoint.AxMappointControl.OpenMap(String fileName) in c:\\Program
Files\\Microsoft MapPoint\\axmappoint.cs:line 299\r\n
at MyMap.RMMapPoint.RMMapPoint_Load(Object sender, EventArgs e) in
C:\\_RM_Root\\RM_Source\\MyMap\\Form1.cs:line 128" s
this line is (as I used /source swicth, just to have the code)
MapPoint.Map returnValue =
((MapPoint.Map)(this.ocx.OpenMap(fileName)));
P.S. a call to Newmap has exactly same effect
--