Community of VE/MapPoint Users and Developers
This is a discussion on Mappoint Issue in vista within the MapPoint 2006/2009 Discussion forums, part of the Map Forums category; Hi to all , Recently I have faced a strange bug in my C# project. The project aim is to ...
| |||||||
| Register | Blogs | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| |||
| Mappoint Issue in vista Recently I have faced a strange bug in my C# project. The project aim is to display Microsoft MapPoint and was developed using VS2005(32 bit version) under Windows XP OS. I used the x86 option at the time of build. After this,I deploy EXE file and supported dll for mappoint from XP system to Vista(64bit) OS. The Exe File executed successfully and switch back to 32 bit mode in Vista. Works all other features of the project exactly I expected except in the case of MapPoint control, when I try to display MapPoint, an error prompted saying "Mappoint failed to load. The cause of this exception is unknown". After this I develop entire project under Vista OS MapPoint work smoothly. Please suggest a solution. ************** Exception Text ************** System.ArgumentException: MapPoint failed to load. The cause of this failure is unknown. at MapPoint.IMappointCtrl.NewMap(Object Template) at AxMapPoint.AxMappointControl.NewMap(Object template) at MappSampleC.Form1.button1_Click(Object sender, EventArgs e) in D:\Shared\MapPoint\MappSampleC\Form1.cs:line 38 at System.Windows.Forms.Control.OnClick(EventArgs e) at System.Windows.Forms.Button.OnClick(EventArgs e) at System.Windows.Forms.Button.OnMouseUp(MouseEventAr gs mevent) at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks) at System.Windows.Forms.Control.WndProc(Message& m) at System.Windows.Forms.ButtonBase.WndProc(Message& m) at System.Windows.Forms.Button.WndProc(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.O nMessage(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.W ndProc(Message& m) at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) ************** Loaded Assemblies ************** mscorlib Assembly Version: 2.0.0.0 Win32 Version: 2.0.50727.312 (rtmLHS.050727-3100) CodeBase: file:///C:/Windows/Microsoft.NET/Fra...7/mscorlib.dll ---------------------------------------- MappSampleC Assembly Version: 1.0.0.0 Win32 Version: 1.0.0.0 CodeBase: file:///D:/bin/Debug/MappSampleC.exe ---------------------------------------- System.Windows.Forms Assembly Version: 2.0.0.0 Win32 Version: 2.0.50727.312 (rtmLHS.050727-3100) CodeBase: file:///C:/Windows/assembly/GAC_MSIL...dows.Forms.dll ---------------------------------------- System Assembly Version: 2.0.0.0 Win32 Version: 2.0.50727.312 (rtmLHS.050727-3100) CodeBase: file:///C:/Windows/assembly/GAC_MSIL...089/System.dll ---------------------------------------- System.Drawing Assembly Version: 2.0.0.0 Win32 Version: 2.0.50727.312 (rtmLHS.050727-3100) CodeBase: file:///C:/Windows/assembly/GAC_MSIL...em.Drawing.dll ---------------------------------------- System.Configuration Assembly Version: 2.0.0.0 Win32 Version: 2.0.50727.312 (rtmLHS.050727-3100) CodeBase: file:///C:/Windows/assembly/GAC_MSIL...figuration.dll ---------------------------------------- System.Xml Assembly Version: 2.0.0.0 Win32 Version: 2.0.50727.312 (rtmLHS.050727-3100) CodeBase: file:///C:/Windows/assembly/GAC_MSIL...System.Xml.dll ---------------------------------------- AxInterop.MapPoint Assembly Version: 1.0.0.0 Win32 Version: 1.0.0.0 CodeBase: file:///D:/bin/Debug/AxInterop.MapPoint.DLL ---------------------------------------- Interop.MapPoint Assembly Version: 1.0.0.0 Win32 Version: 1.0.0.0 CodeBase: file:///D:/bin/Debug/Interop.MapPoint.DLL ---------------------------------------- MapApp Assembly Version: 1.0.0.0 Win32 Version: 1.0.0.0 CodeBase: file:///D:/bin/Debug/MapApp.DLL ---------------------------------------- Microsoft.VisualBasic Assembly Version: 8.0.0.0 Win32 Version: 8.0.50727.312 (rtmLHS.050727-3100) CodeBase: file:///C:/Windows/assembly/GAC_MSIL...isualBasic.dll ---------------------------------------- ************** JIT Debugging ************** To enable just-in-time (JIT) debugging, the .config file for this application or computer (machine.config) must have the jitDebugging value set in the system.windows.forms section. The application must also be compiled with debugging enabled. For example: <configuration> <system.windows.forms jitDebugging="true" /> </configuration> When JIT debugging is enabled, any unhandled exception will be sent to the JIT debugger registered on the computer rather than be handled by this dialog box. Last edited by talish; 08-25-2008 at 08:33 AM. |
| |||
| Re: Mappoint Issue in vista NX_COMPACT BIT DEP is short for Data Execution Prevention. It is a technology that exists in Microsoft operating systems which prevents execution of code from memory pages which are not marked as executable. DEP exists to reduce the attack surface available to malicious software that is trying to hijack a process, and it has been acknowledged to be very helpful in that regard. In Windows Vista, the set of processes and applications to which DEP is applied is configurable by administrators, but there is also a role for application developers. In the header of a PE file there is a flag called IMAGE_DLLCHARACTERISTICS_NX_COMPAT. This flag affects whether or not the OS enables DEP for a process. Setting this flag tells the OS that the image is compatible with DEP. For executable images, if this flag is set, the process is run with DEP enabled unless the machine is configured with the DEP policy set to AlwaysOff. If the image is a DLL and the flag is set, the OS skips checking the DLL against a compatibility database which results in a small performance improvement. All of this applies to x86, 32-bit processes only. On a 64-bit OS, DEP is always enabled for 64-bit processes, but 32-bit processes are configured by the PE flag and system policy as described above. So how does one control the flag in the PE header? Since the C# compiler emits PE files which are MSIL only and therefore compatible with DEP, the output binaries from the VS 2008 and .NET 3.5 C# compilers have this flag set. Our expectation is that the vast majority of C# executables produced by these compilers will be part of a DEP-compatible application. For that reason we did not surface a compiler switch to configure the NXCOMPAT setting. Of course you can write a C# application that uses a native or mixed binary which is not compatible with DEP. Some ATL types in 7.1 and earlier used to do simple code generation into data pages which is a DEP no-no. If your application is generating IP_ON_HEAP exceptions, then you may need to clear the IMAGE_DLLCHARACTERISTICS_NX_COMPAT flag for your executable. To do this you can use EDITBIN.EXE from the VC toolset like so: editbin.exe /NXCOMPAT:NO <your binary> If you're using Visual Studio, you can add a post build step to your executable's project. You'll need to setup the environment so that EDITBIN's dependencies can be resolved. Since the post build steps you author in Visual Studio's properties page are written into a batch file that is launched by the build process, you can use Visual Studio's VSVARS32.BAT to establish the right environment. My post build step looks like this: call $(DevEnvDir)..\tools\vsvars32.bat editbin.exe /NXCOMPAT:NO $(TargetPath) If you sign the binary in Visual Studio, flipping the IMAGE_DLLCHARACTERISTICS_NX_COMPAT flag in the post build step after the binary has been signed will result in an assembly that will fail strong name validation. To work around this you'll need to begin signing your binary as part of the post build steps. To do this, use SN.EXE from the Windows SDK. The .NET 2.0 and VS 2005 compilers are also affected We like DEP so much that when you install .NET Framework 2.0 SP1 your C# compilers in VS 2005 and .NET Framework 2.0 will also begin to emit binaries with the IMAGE_DLLCHARACTERISTICS_NX_COMPAT bit set. This will undoubtedly surprise a few developers...download a framework service pack, recompile, run your app, and you're now getting IP_ON_HEAP exceptions. Obviously this is not ideal, but aggressively building a computing ecosystem filled with DEP-enabled applications and their accompanying security benefits is very beneficial to Windows users. If you begin to encounter IP_ON_HEAP exceptions after installing .NET Framework 2.0 SP1, you can use the same technique described above to clear the IMAGE_DLLCHARACTERISTICS_NX_COMPAT bit in VS 2005. The only difference I'm aware of is that the SDK (and therefore the location of SN.EXE) has moved. |
![]() |
| Tags |
| issue, mappoint, vista |
| ||||
| Posted By | For | Type | Date | |
| Using a DSN-less Connection to a SQL Server Database to Get Data for Maps - MapPoint Articles - MP2K Magazine | This thread | Refback | 08-25-2008 05:35 PM | |
| Programming with MapPoint 2004 using the .NET Framework - MapPoint Articles - MP2K Magazine | This thread | Refback | 08-25-2008 04:38 PM | |
| MP2Kmag Talks with Fresh Logic Studios - MapPoint Articles - MP2K Magazine | This thread | Refback | 08-24-2008 04:26 AM | |
| Advanced GPS For MapPoint - AGPS - MP2K Magazine | This thread | Refback | 08-22-2008 03:55 PM | |
| The Magazine for MapPoint - MP2K Magazine | This thread | Refback | 08-22-2008 01:05 PM | |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
| |
| ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Mappoint 2006, C#, VS 2008, Vista, COM object problems | jovo | Development | 7 | 09-21-2008 06:22 PM |
| Mappoint Installation issue | jacky3212 | MP2K Magazine Articles | 2 | 07-19-2008 01:08 AM |
| MapPoint 2006 vista problem | dluper | MapPoint 2006/2009 Discussion | 1 | 07-17-2008 02:19 AM |
| VISTA and mappoint 2007 data importing | mastaBH | MapPoint 2006/2009 Discussion | 8 | 08-17-2007 11:11 AM |
| Mappoint WebService Issue with Axis | in.bharath | MapPoint Web Service and Virtual Earth | 1 | 03-14-2006 04:28 AM |