|
Ok, what you want is to reflect notifications. For this you will have to add REFLECT_NOTIFICATIONS() to the bottom of the containing window's message map:
BEGIN_MSG_MAP(thisClass)
...
REFLECT_NOTIFICATIONS()
END_MSG_MAP()
Then, change your NOTIFY_CODE_HANDLER with REFLECTED_NOTIFY_CODE_HANDLER . You may also want to add a DEFAULT_REFLECTION_HANDLER() to the end of your List's message map.
Things should work, now.
|
|
|
|
|
Thanks for explaining me this! However, it still doesn't work....function isn't called...
|
|
|
|
|
What are the template arguments for CWindowImpl?
|
|
|
|
|
class CContactlist : public CWindowImpl<ccontactlist, clistviewctrl="">
|
|
|
|
|
Shouldn't this be:
class CContactlist : public CWindowImpl<CContactList, CListViewCtrl>
?
|
|
|
|
|
Yeah that's what i have, i forgot to put it in a code tag... it's exactly what i have.
|
|
|
|
|
Where is the list contained?
|
|
|
|
|
It's contained the View...
|
|
|
|
|
Please show the code for the container's message map and class declaration. I'm on MSN: joao.fig@mail.telepac.pt
|
|
|
|
|
If I write an application that uses an ActiveX Control to embed a component from another application, does that application have to be installed on the computer that will be running my application for it to work. For instance if I embed an excel spreadsheet or chart into my application and then I install my application on a friends computer must he have Excel installed?
Sincerely,
Mardigin
|
|
|
|
|
Mardigin wrote:
For instance if I embed an excel spreadsheet or chart into my application and then I install my application on a friends computer must he have Excel installed
Yes, Excel must be installed on the computer if you are embedding Excel spreadsheet.
Michael
'War is at best barbarism...Its glory is all moonshine. It is only those who have neither fired a shot nor heard the shrieks and groans of the wounded who cry aloud for blood, more vengeance, more desolation. War is hell.' - General William Sherman, 1879
|
|
|
|
|
Thank you for your reply.
I actually setup a windows 98 box without anything installed on it and wrote a quick little utility that had excel embeded into it. You are absolutely correct, when I try to execute it on the windows 98 box absolutely nothing happens.
Thanks again for the feedback.
Mardigin
|
|
|
|
|
Is it possible to release the memory allocated for an item in a deque when you remove an item from a deque using either pop_back() or erase(). I'm trying to avoid the large delay when deleting the deque object.
typedef struct
{
BYTE b;
WORD w;
DWORD d;
}S;
void func(void)
{
deque<S> *pDeque=new deque<S>;
S s={1,2,3};
for (int i=0;i < 100000;i++)
{
s.d=i;
pDeque->push_back(s)
}
while (pDeque->size())
pDeque->pop_back();
delete pDeque;
}
Systems AXIS Ltd - Software for Business ...
|
|
|
|
|
Steve Thresher wrote:
I'm trying to avoid the large delay when deleting the deque object
simple. don't delete the deque.
Prefer storing STL containers on the stack rather than on the heap, after all that's one of the huge benefits of using STL containers. In this case prefer passing it in as a parameter and recycling it. If you've profiled the method this should give some kind of performance boost.
Passing the container also has the benefit of not allocating space for an element every time you push_back. The push_back is what's making the destructor so slow, because the allocator has to destroy all the elements you've just created, as well as the (comparatively small) empty deque.
If you can keep you head when all about you
Are losing theirs and blaming it on you;
If you can dream - and not make dreams your master;
If you can think - and not make thoughts you aim;
Yours is the Earth and everything that's in it.
Rudyard Kipling
|
|
|
|
|
As far as I know using the stack makes no difference as the deque will still be deleted when it goes out of scope and I will still be left with a pause.
How are you supposed to add elements if you don't use push_back()?
Systems AXIS Ltd - Software for Business ...
|
|
|
|
|
I'm surprised that the memory for the item isn't being deleted in the pop_back(). You've you stepped into the pop_back() code in the debugger to verify this, or looked at the source?
Even if it is though, I don't think it would help in your example. ie. Whether they are deleted in your pop_back() loop or by the delete pDeque would have the same affect.
I think the problem here is the sheer size of the container and the fact that you are doing 100,000 new/delete (malloc/free). There are several fast malloc/free implementations which would help or maybe you shouldn't be using a deque for this.
Neville Franks, Author of ED for Windows. Free Trial at www.getsoft.com
|
|
|
|
|
Hi, i did develop an ATL component, based on a Composite Control. This Component must be used on a VB App or a Delphi APP. I want to set an alignment property(e.g align to bottom, align to top, align to client....)like the one present in some controls. I tried to do this by processing messages sent to my control, but none of them are related to Parent App movement. Any idea how can I accomplish this?
Tnx
|
|
|
|
|
I am writing the addin in ATL. To implement the desired feature i want to access the information about the classes included in the workspace. Anyone knows how to get the information.
Thanx
-qur
|
|
|
|
|
I am trying to create an object derived from IFont... I want to add a few properties...
I have used the wizard to create my IMyFont and replaced IDispatch by IFont in the interface declaration.
Also replaced in the BEGIN_COM_MAP(CMyFont) the COM_INTERFACE_ENTRY(IDispatch) by COM_INTERFACE_ENTRY(IFont) but still I have some compilation errors ... cannot instantiate abstract class.
I suspect I have to change something in the list of derived class from CMyFont... mess about with
public IDispatchImpl<imyfont, &iid_imyfont,="" &libid_vistactrllib="">
but how?
Any idea welcome!
Thanks,
Jerry
|
|
|
|
|
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.
|
|
|
|
|
i have a vector of structur like that :
struct CharacterCoordinate<br />
{<br />
GLfloat xpos;<br />
GLfloat zpos;<br />
int Xahead,Zahead;<br />
double pasZ;<br />
double pasX;<br />
<br />
<br />
};
and i want to remove just some of them from the vector and i make like follow:
<br />
void Scene::RemoveCharacter(int amount)<br />
{<br />
CharacterCoordinate PtrCreat;<br />
<br />
int numCharacter = CharacterPos.size();<br />
<br />
for(int i=0;i<amount;i++)<br />
{<br />
<br />
PtrCreat = CharacterPos[numCharacter - 1];<br />
CharacterPos.pop_back();<br />
delete PtrCreat;<br />
<br />
<br />
}<br />
}<br />
but it don't work,what's the problem in that??
|
|
|
|
|
There's quite a few problems in that snippet mate.. But if you want to remove an element or range of elements from a vector, then use vector::erase. Calling delete on stack allocated objects is a pretty bad idea too.
Ryan
|
|
|
|
|
Please use the 'Preview' button to check for problems before posting your messages. It'll make it much easier to answer your questions. Thanks
- Mike
|
|
|
|
|
|
You're missing the '<' in your for header. I had to look at the page source to see what your code for that line was.
I'm assuming that RemoveCharacter() is just supposed to remove amount entries from the end of the CharacterPos vector. There are a number of problems with your code:
First, you're using vector::pop_back() which decreases the size of the vector each time, but you're always getting the item at numCharacter - 1 . After one iteration, that index no longer exists. I think you want CharacterPos[CharacterPos.size()-1] instead. Note that you can get the last element with CharacterPos.back() , which is equivalent.
Second, what type is CharacterPos ? Is it a vector<CharacterCoordinate> or a vector<CharacterCoordinate*> ? We need to know. Please include the error you're getting as well.
As an aside, if CharacterPos is of type vector<CharacterCoordinate> , then you don't need a for-loop. Look up the vector::resize function.
- Mike
|
|
|
|