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

Signature
andrew
"Peter Huang" [MSFT] - 23 Mar 2006 04:37 GMT
Hi Andrew,
Thanks for your quickly posting!
I understand that you upgrade your MAP 2002 to 2004 and the winform app
using MapPoint control did not work.
or You uninstall the MAPpoint 2002 and install 2004.
Also from the error, it seems that the mappoint control did not recognize
the file.
Have you tried to open the file directly in MAPPoint 2004 application?
Did that work?
Also we may try to create a winform application and drag the new mappoint
control from the toolbox to see if that works.
That will help us to isolate the problem.
Best regards,
Peter Huang
Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
andyreseller - 23 Mar 2006 09:21 GMT
First, - yes, the MapPoint.exe CAN disply maps - both one of mine and all of
Sample
Second - I've created a WinForm with the only Control dragged from the
Toolbox - it doesn't work same way
On my machine I never had any MP version installed before. I installed
MP-2004 and started getting this error
On another machine in the company we had (still have) a demo. The demo is
running the same WinForm executable, which I'm building, and is able to
display maps.
That machine has both OCX and MP.exe same version as mine (2004)
My apologies for the confusion, but I couldn't find any traces of MP-2002 on
that machine. It was before my time, so maybe the 2002 story is a myth.
The bottom line is: on freshly installed MP2004, I'm getting this error, on
ALL maps I tried. ; the executable itself can open maps - all of them.

Signature
andrew
"Peter Huang" [MSFT] - 24 Mar 2006 07:24 GMT
Hi Andrew,
Based on my understanding, on another machine with MAPPoint 2004 newly
installed.
You can not reproduce the problem.
So the problem is machine specific.
Based on my test at my side, I can not reproduce the problem, either.
So far I suggest you try to use the MAPPoint control on a legacy VB6
application to see if that works.
So that we will know if the problem specific to the .NET framework or the
MAP Point control itself.
Best regards,
Peter Huang
Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.