MapPoint Forums

MapForums

Community of MapPoint and Bing Maps 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 Desktop 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 Desktop Discussion > Development

Today's Posts Twitter Feed Register Blogs FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #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
Location: Belgium
Posts: 2,410
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


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 02:46 PM
Re: MapPoint 2006 kaka MapPoint Desktop Discussion 0 02-23-2007 02:23 AM
Difference between MapPoint 2006 and MapPoint 2006 Fleet jlewis MapPoint Desktop Discussion 1 11-21-2006 08:18 AM
MP 2006 & VB6 Sample Code Mike2005 MapPoint Desktop Discussion 1 06-18-2006 11:23 AM
MapPoint 2006, etc. farm_cart MapPoint Desktop Discussion 4 04-03-2006 11:28 AM


All times are GMT -5. The time now is 02:39 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.5.0 RC3
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 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70