MapPoint Forums

MapForums

Community of VE/MapPoint Users and Developers




Registering MapPoint 2006 through code

This is a discussion on Registering MapPoint 2006 through code within the Development forums, part of the MapPoint 2006/2009 Discussion category; My application has an embedded MapPoint 2006 control and works as expected when the current user is the same user ...


Go Back   MapPoint Forums > Map Forums > MapPoint 2006/2009 Discussion > Development

Register Blogs FAQ Members List Calendar Search Today's Posts Mark Forums Read



Click here to register

Reply

 

LinkBack (1) Thread Tools Display Modes
  1 links from elsewhere to this Post. Click to view. #1 (permalink)  
Old 07-17-2008
Junior Member
White Belt
 
Join Date: Mar 2008
Posts: 5
Registering MapPoint 2006 through code

My application has an embedded MapPoint 2006 control and works as expected when the current user is the same user that installed MapPoint. However, when another user logs in my application fails to find MapPoint. I've discovered the reason for this is that MapPoint is not registered for the current user; once the current user registers MapPoint (either by manually registering or by running MapPoint once) my application works again.

I'd like to register MapPoint for the current user through code when the application is run so that the user won't have to take the step of doing it manually. Anyone know if and how this can be done in MFC?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #2 (permalink)  
Old 07-18-2008
Senior Member
Black Belt
 
Join Date: Nov 2004
Posts: 2,122
Re: Registering MapPoint 2006 through code

Hi,

An easy workaround is to run mappoint.exe from within your code at first start or during setup.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3 (permalink)  
Old 07-18-2008
Junior Member
White Belt
 
Join Date: Mar 2008
Posts: 5
Re: Registering MapPoint 2006 through code

Here's the solution I found, in case someone else comes along with the same problem:

Code:
STARTUPINFO si;
PROCESS_INFORMATION pi;

ZeroMemory( &si, sizeof(si) );
si.cb = sizeof(si);
ZeroMemory( &pi, sizeof(pi) );

if( !CreateProcess( NULL,   
    "\"C:\\Program Files\\Microsoft Mappoint\\MapPoint.exe\" -regserver", 
    NULL, 
    NULL, 
    FALSE, 
    0, 
    NULL, 
    NULL,
    &si, 
    &pi )
    )
{
    return;
}

// Wait until child process exits.
WaitForSingleObject( pi.hProcess, INFINITE );

// Close process and thread handles. 
CloseHandle( pi.hProcess );
CloseHandle( pi.hThread );
You could add to this by reading the install directory from the registry instead of hard coding it.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Tags
code, mappoint 2006, registering


LinkBacks (?)
LinkBack to this Thread: http://www.mapforums.com/registering-mappoint-2006-through-code-8070.html

Posted By For Type Date
Spatial Data Importer Contest Submission - MP2K Magazine This thread Refback 07-21-2008 01:13 PM

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads

Thread Thread Starter Forum Replies Last Post
mappoint 2006 help? c2linguist Development 0 06-17-2008 03:46 PM
Re: MapPoint 2006 kaka MapPoint 2006/2009 Discussion 0 02-23-2007 03:23 AM
Difference between MapPoint 2006 and MapPoint 2006 Fleet jlewis MapPoint 2006/2009 Discussion 1 11-21-2006 09:18 AM
MP 2006 & VB6 Sample Code Mike2005 MapPoint 2006/2009 Discussion 1 06-18-2006 12:23 PM
MapPoint 2006, etc. farm_cart MapPoint 2006/2009 Discussion 4 04-03-2006 12:28 PM


All times are GMT -5. The time now is 10:12 PM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0
MP2K Magazine
Visitor Map


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54