MapPoint Forums

MapForums

Community of VE/MapPoint Users and Developers




SelectionChange(NewSelection,OldSelection) in VC++

This is a discussion on SelectionChange(NewSelection,OldSelection) in VC++ within the MapPoint 2006/2009 Discussion forums, part of the Map Forums category; I thaught this thread wasn't necessary, but after reading some articles here, I finally decided to open a new thread ...


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

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 01-03-2007
Member
Green Belt
 
Join Date: Nov 2006
Posts: 88
SelectionChange(NewSelection,OldSelection) in VC++

I thaught this thread wasn't necessary, but after reading some articles here, I finally decided to open a new thread anyway.

I've read this forum: Catch mappoint events using C++ (without MFC...)

But still have one problem and that is:

Code:
OnSelectionChangeControlMap(LPDISPATCH pNewSelection, LPDISPATCH pOldSelection) 
{
    //HRESULT hr = pNewSelection->QueryInterface(__uuidof(Pushpin), 

    // Get old selection - if it is a pushpin, hide the notes/caption
    if (pOldSelection)
    {
        CPushpin *pOldPin;
        HRESULT hr = pOldSelection->QueryInterface( __uuidof(CPushpin)  , (void**)&pOldPin);
        if (SUCCEEDED(hr))
        {
            //some codeprocessing
        }
    }

    // Get new selection - if it is a pushpin, display notes/caption and modify it    
    if (pNewSelection)
    {
        CPushpin *pNewPin;
        HRESULT hr = pNewSelection->QueryInterface( __uuidof(CPushpin)  , (void**)&pNewPin);
        if (SUCCEEDED(hr))
        {
            //some coding
            //some coding agian ;)
        }
    }

}
and the compilor-error is:
Code:
 'CPushpin' : no GUID has been associated with this object
 'CPushpin' : no GUID has been associated with this object
In the forum I've read, they used Pushpin instead of CPushpin.
I also tried with 'Pushpin', but it didn't matter.
So does someone know how to get the right GUID of Pushpin?? I'm not a specialist in COM, only understand what's going on a little.

Last edited by VC_Man; 01-03-2007 at 10:56 AM.
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 01-03-2007
Senior Member
Black Belt
 
Join Date: Nov 2004
Posts: 2,122
Re: SelectionChange(NewSelection,OldSelection) in VC++

Hi,

I assume you have to find it in some #include file. But I never worked with MapPoint in VC++, so someone else has to drop in here.
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 01-04-2007
Member
Green Belt
 
Join Date: Nov 2006
Posts: 88
Re: SelectionChange(NewSelection,OldSelection) in VC++

I've solved the problem, maybe someone else can use it too!
Wtih __uuidof(GUID), this function needs some reference to find out what the GUID is. In Google you can find what GUID is (is a unique ID for a com-object or interface ID of an object: GlobalUniqueIDentifier). Anyway, in my previous snippet of code it needs the ID of Pushpin object.

What I did was give the function __uuidof() the parameter of the class CPushpin, or an instance of CPushpin. But CPushpin has a member pointer to a Dispatch of the Pushpin COM object. Actually, CPushpin is a wrapperclass of Pushpin COM object, I mean in C++/VC++. So you need the member CPushpin::m_lpDispatch to get to the interfaces of Pushpin COM object.


Anyway, the result is: __uuidof(Pushpin::m_lpDispatch)

Good luck!
Btw, thanks Wilfried
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #4 (permalink)  
Old 01-04-2007
Senior Member
Black Belt
 
Join Date: Nov 2004
Posts: 2,122
Re: SelectionChange(NewSelection,OldSelection) in VC++

Hi,

Thank you also for feedback as this for sure benefit others.
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
oldselection


LinkBacks (?)
LinkBack to this Thread: http://www.mapforums.com/selectionchange-newselection-oldselection-vc-5542.html

Posted By For Type Date
Finding Sites Within a Specified Distance From an Address - MapPoint Articles - MP2K Magazine This thread Refback 01-04-2007 06:50 AM

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
SelectionChange Event calv1ns MapPoint 2006/2009 Discussion 1 10-12-2006 01:55 PM
SelectionChange event Yazzy MapPoint 2006/2009 Discussion 0 05-16-2006 10:25 AM


All times are GMT -5. The time now is 12:59 AM.


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 55