| | nprimex1 09-21-2006, 02:24 PM wow, well I really appreciate the help i've received from this forum over the last year.
Honestly, haven't been putting much time into dev ... just as I was getting somewhere with 04, 06 came out. I created a basic .NET C# MP app which tracks location via GPS.
I removed the activex control for 2004 and added activex MP 2006 control. However, now i'm getitng alot of classes not matching, etc.
I thought it was the same minus the 2 additional features and map data?? Wilfried 09-22-2006, 03:15 AM Hi,
Correct nothing has to be changed.
However a application compiled with MP2004 ocx will not run with MP2006 map and also the way around. This is because the changed Location object which has now additional properties. Is that the problem ?
If you have another problem please explain, it should be solved easy (I hope), as it works here fine after upgrading to MP2006. xjack 09-23-2006, 06:52 AM I'm not quite following ... My application was compiled using the 2004 .ocx and includes a 2004 template ... The Mappoint application is installed on each individual client machine ... At present all clients are using 2004, but next week I have a new client installing who has 2006 installed ... Can I expect problems ??? Wilfried 09-23-2006, 09:22 AM Hi,
Unfortionally yes :( The problem is the Location object, it is different in MP2006, so accessing it will generate an access violation.
I just did an extra test to be sure. First registered MP2004 ocx, rebuild program, then registered MP2006 and start outside debugger (to be sure no recompile). The momen you want to do something with eg a returned Location object there was an AV.
So you really have to install MP2006 also on your develop machine. I register them with 2 batch files that also copy a file with a static class to a common folder where the development sourses are, so that it is al automated.
If you need more detail on how I did it then please say so. There are probably many approach but found this the most easy Wilfried 09-23-2006, 10:02 AM Hi,
I forgot to say, I'm using C#. Possible behaviour in VB or others is different. For developers only using the type library (using MP object model) behaviour is probably also different. xjack 09-25-2006, 08:56 AM Wilfred ...
Thanks very much for the quick response ...
Re the batch files ... are these something to simply rename or move the appropriate files to the referenced locations and to the executable path ... run prior to compiling or debugging ???
I will probably start testing with this tomorrow and will probably have other questions ...
Again, thanks ...
Jack Wilfried 09-26-2006, 02:25 AM Hi,
Yes and no. Tht batch files do 2 thing.
- They register the right MapPoint version
- They copy a file with a class so that compiled program know what mappoint version it need.
This way it can detect on runtime he is talking with the right mappoint before generating errors and give the user a warning.
In both of my MP folders I have batch file with this content:
MapPoint.exe /registerserver
copy MPVersion.cs C:\Ontwikkeling\NET\VC#\MP
So they register the right mappoint and copy the MPVersion.cs to a shared folder used in all my mappoint projects. Content of file is just the MP version:
namespace MPVersion
{
public static class MPVersion
{
public const int Version = 13;
}
}
Version 13 if MP2006 and 11 is MP2004. At runtime I compare the compiled version and the version in the Version property of the MP control and if they dont match I generate a warning and quit the program. nprimex1 09-26-2006, 11:57 AM Hi Wilfried,
Thanks for taking the time to help me out here. I'm still trying to pinpoint my issue ... will post up exact details.
But a quick question ... in C#, have u been able to add in the "Driving Guidance" window and all it's functionality (voice command, etc.) ? I read the article for VB that's posted in the annoucnement, but was wondering if it was applicable to C#. Wilfried 09-26-2006, 01:16 PM Hi,
Sorry cannot help on this one as I did not test this because lack off time and interesse. But if it works in VB then it should be applicable in C# as whell. nprimex1 09-27-2006, 02:14 AM Hi Wilfried,
They say that in MapPoint 2006, the MapPointControl object is supported only in Visual Basic 6.0. MappointControl object is basically used to implement new additions in mp 2006
Basically I followed these steps as directed my Microsoft Mappoint Help
Referencing the MapPoint Control 13.0
In Visual Studio .NET 2003
On the Tools menu, select Add/Remove Toolbox Items.
In the Customize Toolbox dialog, select the COM Components tab.
In the list of components, select Microsoft MapPoint Control 13.0. Be sure to select the check box to the left of this component.
Click OK. The component has been added to your toolbox and can be used in a project.
So everything is fine and the activeX control reads Mappoint Control 13.0 and so does the axMappointControl object.
Does this mean that I will not be able to integrate the Driving Guidance Pane and the GPS Task Pane (2 new additions in MP 2006) in .NET using the Mappoint ActiveX Control 13.0 as guided by MSDN.
Is there any bypass to this in .NET ? Wilfried 09-28-2006, 07:29 AM Hi,
I'm not sure. I searched the programming help and I could not find anything of this feature in it. xjack 09-30-2006, 07:52 AM Wilfred ...
My 2004 App seems to workly perfectly on my new 2006 client without any changes ... I did NOT install 2006 on my development machine ...
I am programming in VB.NET (VS 2003) ... I reference the 2004 Mappoint Interop dlls but do not register them, and I include the 2004 Mappoint .ocx and .dll in the executable path ... more than 10 forms use the Mappoint Control and the location object is called numerous times ... I always load Mappoint into the control using a template (.ptm) file created in 2004 ...
2006 seems to run a bit slower, but so far has not been a problem ... Wilfried 10-01-2006, 07:16 AM Hi,
That is interesting news :)
Probably the way around will work also (using MP2006 ocx + dll's on a machine with MP2004 registered) sam way. It is word to test it.
Which *.dll 's do you include in execuable path ? xjack 10-01-2006, 07:59 AM ... Interop.MapPoint.dll ... version 1.0.0.0 ...
and
... MapPointControl.ocx ... version 11.0.18.1900 ...
are both placed in the executable path (the same directory as the executable) during installation ...
References in the program are to ...
... AXInterop.MapPoint.dll ... version 1.0.0.0 ...
and
... Interop.Mappoint.dll ... version 1.0.0.0 ...
Setup added as a detected dependency the MappointControl.ocx Wilfried 10-01-2006, 10:47 AM Hi,
Those *.dll's are normal in the exe path, but not the *.ocx of course. I did the test, registered MP2004, did a rebuild, registered MP2006, copy the *.ocx version 2004 into the executable path.
Maybe I forgot something, or maybe it is different in C#. Will try again one of these days. xjack 10-02-2006, 07:43 AM I can't imagine that the programming language would make this difference ... I would rather think that the fact that 2006 was never installed on my development machine has something to do with it ...
I have noticed that 2006 has MANY more registry entries that 2004 ...
--Jack sandycurrie 10-02-2006, 10:58 AM Hey guys,
I seem to be having the same problem, where I have recently upgraded from MP2004 to MP2006. Currently I have both installed on my dev computer and wish to compile my application for one or the other versions with as little code changing as possible.
Wilfried: How are you referencing MapPoint in your application, when using the batch file? I've tried a different method where you dig into the .vbproj file and edit the references from there, but learned that the GUIDs for each library are stored there. So even though you register the desired version of MP, how does that change the references within VS to the correct library?
Thanks in advance! Wilfried 10-03-2006, 07:31 AM Hi,
I had to search for that because by default VS copy it all in the project folder. I almost discoverd it by accident how to do :)
If you right click the project, then 'Add' then 'Existing item', after selecting it dont click OK, but near the button is a little arrow. Clicking it brings up a popup menu and you can click 'Add as link'. Then it is not copied and the version class can be used by all projects.
Maybe there are other approach as well. Maybe I need to RTFM :) | |