Community of VE/MapPoint Users and Developers
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 ...
| |||||||
| Register | Blogs | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| |||
| SelectionChange(NewSelection,OldSelection) in VC++ 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 ;)
}
}
}
Code: 'CPushpin' : no GUID has been associated with this object 'CPushpin' : no GUID has been associated with this object 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. |
| |||
| 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.
__________________ rgds, Wilfried Mestdagh www.mestdagh.biz MapPoint coding demo Order MapPoint 2009 with Routing and User Tools Spreadsheet |
| |||
| 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 |
| |||
| Re: SelectionChange(NewSelection,OldSelection) in VC++
Hi, Thank you also for feedback as this for sure benefit others.
__________________ rgds, Wilfried Mestdagh www.mestdagh.biz MapPoint coding demo Order MapPoint 2009 with Routing and User Tools Spreadsheet |
![]() |
| Tags |
| oldselection |
| ||||
| 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 | |
| |
| ||||
| 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 |