Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Visual Studio.NET / Debugging / May 2008

Tip: Looking for answers? Try searching our database.

MapPoint and VS2008 and Vista cross thread execption

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Crash - 05 May 2008 18:44 GMT
Hello,

We are migrating a major development to .NET/VS2008 and have encountered the
same error as many others (acorrding to the number of posts), however most
of these posts are over 7 months old and none really offered a solution, so
I thought I would try again.

The problem:
After dropping the MapPoint OCX onto the form and attempting to compile, I
receive the following error:
Cross-thread operation not valid: Control 'axMapper' accessed from a thread
other than the thread it was created on.
Also, the MapPoint control is never visible. This appears to be an issue
with VS20008 + Vista, as things work as expected in VS2008 + XP Pro.

Setting Control.CheckForIllegalCrossThreadCalls = false; allowed the
application to compile, but MapPoint remained invisible, also, making this
call makes me very nervous.

Additionally, the application created and compiled with VS2008 + XP Pro and
VS2005 + XP Pro does not run on a Vista computer with VS2008; however, the
same test applications (created with VS2005 and VS2008) DO run on a Vista
computer that does not have VS2008 installed.

Finally, MapPoint applications created with Borland Delphi work fine on the
Vista dev computer with VS2008 installed.

Thanks in advance,
Craig
Jialiang Ge [MSFT] - 06 May 2008 10:26 GMT
Good morning, Craig, and Welcome to Microsoft Newsgroup Support Service! My
name is Jialiang Ge (MSFT) and will work with you in this issue.

PROBLEM DESCRIPTION

We need to create a WinForm application using VS2008 that uses MapPoint
2006 control. This MapPoint 2006 control for MapPoint 2006 doesn't display
in Visual Studio 2008 designer window, and gives the error "Cross-thread
operation not valid: Control 'axMapper' accessed from a thread other than
the thread it was created on." This is happening on Vista Machine.

SUMMARY OF MY TROUBLESHOOTING

The issue which we are facing is due to Data Execution Prevention (DEP).
The MapPoint ActiveX control uses ATL 7.0 and there are known problems with
ATL 7.0 and DEP which are listed in the following article. This article
also contains the various resolution steps which you can try.

Applications Using Older ATL Components May Experience Conflicts With DEP
http://support.microsoft.com/?id=948468

Unfortunately, there will be no fix/change for the MapPoint 2006 ActiveX
control. MapPoint development is aware of the problem and will work to see
that the new version of the control which will work in Visual Studio 2008.

WORKARDOUNDS

Put the code below in Form_Load:
           this.axMappointControl1.Location = new Point(10, 10);
           this.axMappointControl1.Name = "MPC";
           this.axMappointControl1.Size = new Size(100, 100);
           this.axMappointControl1.OpenMap("d:\\North America.ptm");

Use the following code in the post build event, this will create the
executable without NXCOMPAT.

call "$(DevEnvDir)..\tools\vsvars32.bat"
editbin.exe /NXCOMPAT:NO "$(TargetPath)"

This workaround works well on my side. Please try it and let me know the
result.

Regarding non-visibility issue at design time, a mappoint developer told me
we can execute "bcdedit /set nx AlwaysOff" from an Administrative command
prompt. But based on the test in my machine, this does not work. Because
the mappoint team has already confirmed this is an Microsoft Product issue,
all the support incidents regarding the issue from Microsoft CSS will be
free of charge.

Let me know if you have any other concerns or questions, I will spare no
efforts to help you.

Regards,
Jialiang Ge (jialge@online.microsoft.com, remove 'online.')
Microsoft Online Community Support

Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
msdnmg@microsoft.com.

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
Crash - 06 May 2008 16:55 GMT
Thank you for the reply.

I did as you suggested (cut/pasted the code) with the same failed resutls.
   this.axMappointControl1.Location = new Point(10, 10); <--- produced the
error.

I set the post-build to run in all three modes (always, successful build,
when updated) all with the same affect.

I'm not sure we have a work around yet.

Again, thanks for your help,
Craig

> Good morning, Craig, and Welcome to Microsoft Newsgroup Support Service!
> My
[quoted text clipped - 81 lines]
> This posting is provided "AS IS" with no warranties, and confers no
> rights.
Jialiang Ge [MSFT] - 07 May 2008 03:36 GMT
Hello Craig,

I am sorry that the workaround does not work for you. Would you give it a
last try as the following?

Step1. Do not remove the post script in my last reply from your
project->Property->Build page.
Step2. Press Ctrl+F5 to see if the application runs well without debugging.
Step3. Open the project's Property page, and go to "Debug" tab. UNCHECK the
"Enable the Visual Studio hosting process"
Step4. Press F5 to see if the application runs well under debugging now.

If you don't mind, I'd also like to send my test project to you. You can
run it on your side and see if it helps. My mail address is
jialge@microsoft.com. You can send a mail to it so that I can know yours.

If it still cannot work: Because Microsoft product team has recognized and
admitted this Mappoint control issue, we can submit a service request to
Microsoft CSS by using MSDN free support incidents. In this way, you will
talk to a Microsoft Support Professional directly. This should be the
quickest and the most efficient way. Note: the service request will be
free. That means your MSDN free support incidents won't be deducted.

Regards,
Jialiang Ge  (jialge@online.microsoft.com, remove 'online.')
Microsoft Online Community Support

=================================================
Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
msdnmg@microsoft.com.

This posting is provided "AS IS" with no warranties, and confers no rights.
=================================================
Jialiang Ge [MSFT] - 08 May 2008 12:57 GMT
Hello Craig,

Would you mind letting me know the result of the suggestions in my last
reply? Please feel free to let me know if you have any questions or
concerns.

Have a great day!

Regards,
Jialiang Ge  (jialge@online.microsoft.com, remove 'online.')
Microsoft Online Community Support

=================================================
Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
msdnmg@microsoft.com.

This posting is provided "AS IS" with no warranties, and confers no rights.
=================================================
Crash - 08 May 2008 18:45 GMT
Hi,

Sorry for the delay - have been on different project.

The project will not run. Immediately throws dialog box "This program has
stopped responding". I just sent you my e-mail address.

Thanks,
Craig

> Hello Craig,
>
[quoted text clipped - 35 lines]
> rights.
> =================================================

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.