Click here to Skip to main content
15,913,361 members
Home / Discussions / ATL / WTL / STL
   

ATL / WTL / STL

 
GeneralDeleting items from a deque Pin
Steve Thresher11-Jun-03 23:09
Steve Thresher11-Jun-03 23:09 
GeneralRe: Deleting items from a deque Pin
Andrew Walker11-Jun-03 23:55
Andrew Walker11-Jun-03 23:55 
GeneralRe: Deleting items from a deque Pin
Steve Thresher12-Jun-03 0:24
Steve Thresher12-Jun-03 0:24 
GeneralRe: Deleting items from a deque Pin
Neville Franks13-Jun-03 12:44
Neville Franks13-Jun-03 12:44 
GeneralAlignment property on ATL control Pin
john.angel11-Jun-03 6:20
john.angel11-Jun-03 6:20 
GeneralClassView information Pin
qur11-Jun-03 2:59
qur11-Jun-03 2:59 
GeneralATL: Deriving from IFont Pin
BadJerry11-Jun-03 0:47
BadJerry11-Jun-03 0:47 
GeneralHaving problem in hosting Mappoint control from ATL ActiveX control Pin
AishuM10-Jun-03 13:27
AishuM10-Jun-03 13:27 
Development of an ATL Control Container(CRetailMapX) to host Mappoint control using Visual Studio .NET(debug build)
Implementation and Problem Description : I did develop a ATL in-process server component and added a ATL composite control named CRetailMapX (which implements all the default interfaces, those comes when this control was added through the studio wizard).
Steps I followed are like this:
(1) Imported Mappoint MappointControl.ocx to get all the GUIDs for the interfaces/object exposed by mappoint control
#import "C:\Program Files\Microsoft MapPoint\MappointControl.ocx" raw_interfaces_only, raw_native_types, no_namespace, named_guids

(2) Declared member variable of type CAxWindow(also tried with CAxWindow2), to manipulate the window that hosts the Mappoint control.
Also declared IMappointCtrlPtr m_pMapCtl and MapPtr m_pMap, will be used later when mappoint control created on map.
(3) On OnInitDialog() added the code like this

// Display size for the control
RECT rect;
SetRect(&rect, 0,0,100,100);

// Get string from the CLSID of mappoint control
OLECHAR szControlName[40];
StringFromGUID2(CLSID_MappointControl, szControlName, 40);

// Create window based on mappoint control CLSID
>>>>> HWND hWnd = m_MapControl.Create(m_hWnd, rect, OLE2CT(szControlName), WS_CHILD|WS_VISIBLE, 0, 5000);

// Get the IMappointCtrl pointer
HRESULT hr = m_MapControl.QueryControl(&pMapCtl);
if(SUCCEEDED(hr))
{
// Hardcoded variant variable to open North America map
VARIANT vtMyInt;
vtMyInt.iVal = 1;
vtMyInt.vt = VT_I2;

// Create new map, this call require to create new NA map
>>>>> pMapCtl->NewMap(vtMyInt, &pMap);
}

Here is the problem. Everything goes fine till NewMap() method of IMappointCtrl interface called, during the call to NewMap(), execution goes through OnInPlaceActivate() function of CAxHostWindow and asserts.

If all the assertions are ignored, mappoint control will be displayed/created, but no user interactions (by mouse or by keyboard) will be supported.

Even I tried CAxWindow::Attachcontrol() instead of CAxWindow::Create(), but the result is the same, assertions!. Reason is that OnInPlaceActivate() of CaxHostWindow in VS6.0 doesn’t have ATLASSERT statements as compared to OnInPlaceActivate() of CAxHostWindow in VS7.0

Going through the OnInPlaceActivate() of CAxHostWindow, tells that this In-place activation event should not be generated second time. As I mentioned, this event occurred when NewMap() function of Mappoint control is called to show/create a map. As per my understanding of this problem, when first time CAxWindow::Create() is called, prompts in-place activation event which calls OnInPlaceActivateEx() where m_bInPlaceActive was set to TRUE and also queried for m_spInPlaceObjectWindowless. After this when NewMap() is called, also prompt the in-place activation event and calling OnInPlaceActivate(), where all the above assertions comes.


I don't know how to avoid second time generation of in-place activation event, but NewMap() method of IMappointCtrl interface has to be called to create/show either European or North America map.
As per my experimentation in this way for hosting other activex controls (Calender and MSFlexGrid but Mappoint control) works fine, only the difference here is that, just calling CAxWindow::Create() for those controls was enough to displays/creates them, those controls doesn't require us to call something like NewMap()( in case of Mappoint control) to create/display them.
I tried the same implementation on VS6.0, got only the last one of the three assertions mentioned above, sinceCAxHostWindow:: OnInPlaceActivate () doesn’t have ATLASSERT statements to assert for in-place not activated yet and m_spInPlaceObjectWindowless is NULL, but CAxHostWindow:: OnInPlaceActivate() in VS7.0 has those ATLASSERT statements.



Generalvector remove problem Pin
aguest10-Jun-03 9:29
aguest10-Jun-03 9:29 
GeneralRe: vector remove problem Pin
Ryan_Roberts10-Jun-03 9:42
Ryan_Roberts10-Jun-03 9:42 
GeneralRe: vector remove problem Pin
ZoogieZork10-Jun-03 10:48
ZoogieZork10-Jun-03 10:48 
GeneralRe: vector remove problem Pin
aguest10-Jun-03 11:22
aguest10-Jun-03 11:22 
GeneralRe: vector remove problem Pin
ZoogieZork10-Jun-03 13:40
ZoogieZork10-Jun-03 13:40 
GeneralBuild Error "Performing registration" Pin
clayne10-Jun-03 8:32
clayne10-Jun-03 8:32 
GeneralRe: Build Error "Performing registration" Pin
geo_m10-Jun-03 19:39
geo_m10-Jun-03 19:39 
GeneralSome advice on using deque please Pin
Steve Thresher10-Jun-03 8:17
Steve Thresher10-Jun-03 8:17 
GeneralRe: Some advice on using deque please Pin
Joaquín M López Muñoz10-Jun-03 8:46
Joaquín M López Muñoz10-Jun-03 8:46 
GeneralHows this for ugly! Pin
Steve Thresher10-Jun-03 9:47
Steve Thresher10-Jun-03 9:47 
GeneralRe: Hows this for ugly! Pin
Michael Dunn10-Jun-03 13:49
sitebuilderMichael Dunn10-Jun-03 13:49 
GeneralRe: Hows this for ugly! Pin
Steve Thresher11-Jun-03 21:45
Steve Thresher11-Jun-03 21:45 
GeneralOdd linker errors Pin
Tommy2k9-Jun-03 3:52
Tommy2k9-Jun-03 3:52 
GeneralRe: Odd linker errors Pin
Steve S9-Jun-03 4:01
Steve S9-Jun-03 4:01 
GeneralVector in Vector Pin
mpb6-Jun-03 2:02
mpb6-Jun-03 2:02 
GeneralRe: Vector in Vector Pin
Alexandru Savescu6-Jun-03 2:55
Alexandru Savescu6-Jun-03 2:55 
GeneralRe: Vector in Vector Pin
Anonymous6-Jun-03 4:22
Anonymous6-Jun-03 4:22 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.