mfc >> CListCtrl in ActiveX control - redraw problem.

by Arthur » Thu, 20 Jan 2005 18:26:52 GMT

I have an ActiveX control, that creates a child dialog, that has a bunch
of mfc control on it. One of which is a CListCtrl. In the client app,
this all works fine until, the ActiveX control is obscured by either
another program or window in same app (its an mdi app), then the list
control doesn't redraw, when I bring it into the foreground.

Other control on the same ActiveX control redraw fine, just not the list
control. If I click on the list control, it will only redraw the item I
select and the one the got unselected (single selection behaviour).

To get it to redraw I can move the window off the screen, then it will
redraw the part of the list control that got obscured off the edge of
the main client window.

Just noticed also, that if I move another window in front of it, then
move it away, the list control redraws gine. Its just if I move a window
in front of it then, switch to the problem app.

I'm not doing anything clever like custom drawing and the like. Just an
ActiveX control, with a child dialog, which has a collection of controls
on it. Any ideas?

Arthur.


mfc >> RE: CListCtrl in ActiveX control - redraw problem.

by QXNobGV5IE1hcnRpbg » Fri, 21 Jan 2005 18:13:04 GMT





I've got the same problem. My CListCtrl is on a dialog which is being
displayed in a tab control. It's only the currently focused CLitCtrl that
does not redraw. If I put focus in another control on that dialog then
obscure and reveal the dialog then the CListCtrl DOES redraw.

I've noticed that other people have had the same problem but nobody has
suggested a solution which seems to work.

Is there a known bug in CLitCtrl?



Similar Threads

1. Edit control redraw problem

2. Embedded vc++ ActiveX control problem,Is the control is properly r

Dear all,

         I have created one user defined ActiveX control in Embedded VC++ 
4.0.And register this control on Embedded device through 
regsvrce.exe.Successfully register message also appeared.

         Then I have created same name ActiveX control using VC++ for design 
mode.Now register this activeX control for desktop through regsvr32.exe.It is 
also successfully registered.

         And then develop the Embedded VC++ 4.0 application using defined 
ActiveX control.The application gives an error during debug version execution 
as follow.


....
coredll.dll
ole32.dll
CoCreateInstance of OLE control {A96C0280-E20B-4F1B-9A6E-8E80A1C6F3DE} failed.
>>> Result code: 0x80040154
>>> Is the control is properly registered?
coredll.dll
ole32.dll
oleaut32.dll
Warning: CreateDlgControls failed during dialog init.
The thread 0x6382BF12 has exited with code 0 (0x0).
The program 'D:\AcButton\HorImple\X86Dbg\HorImple.exe' has exited with code 
0 (0x0).

           During the release version of application doesn't give the 
error.And control doesn't display at the execution time.

  Please clarify my doubts.
     
Regards

Senthil murugan.
 XXXX@XXXXX.COM 
Inlott E-Gaming Solution Pvt Ltd
Chennai.

3. Embedded vc++ ActiveX control problem,Is the control is proper - Windows CE

4. Creating ActiveX control Within activeX Control

Hi,
I have created an ActiveX control using MFC activeX control wizard and added 
a dialog to it.
Now on that Dialog I dragged a Button control and gave a "hello world" 
message on it click. When I run the control in an activex container it works 
fine.

Now I want to a Datagrid in place of this button. I have inserted datagrid 
and build it I dont get any error. but when I try to open it in ActiveX 
container to see the display. Im getting " Debug assertion Failed " error 
with file winocc.cpp.



Summary: Can we insert ActiveX Control(like DataGrid)  in another ActiveX 
control. If yes, How???



Can anyone help me out.
Thanks in Anticipation.
Vinay 


5. Creating ActiveX control Within activeX Control

6. Activex control events not firing or ActiveX composite control not listening

I'm new to ATL so please bear with me.

I'm using VS2005. I generated a composite ActiveX control to host
ActiveX controls. It will host two or more ActiveX controls. I put the
ActiveX controls on the dialog at design time. I've also put a few
standard buttons.

Here's a clip of the generated class def:
class ATL_NO_VTABLE CTest5Ctrl :
    ....
    public CComCompositeControl<CTest5Ctrl>,
    public IDispEventImpl<IDC_MMHITIMERX1,CTest5Ctrl>,
    public IDispEventImpl<IDC_MMWAVERECORDERX1,CTest5Ctrl>
{...}

I used GetDlgItem() and AtlAxGetControl() to get smart pointers around
the ActiveX controls. I used CAxWindow.Attach() and GetDlgItem() to get
wrappers around the buttons. I did all of this in OnInitDialog -- (side
question: should I be doing this in OnInPlaceActivate?). This, I'm
guessing, doesn't really pertain to my problem, but I put it out there.

I added event handlers for the buttons which then call some methods on
the ActiveX controls. For ex:

LRESULT CTest5Ctrl::OnBnClickedBtnRecord(WORD /*wNotifyCode*/, WORD
/*wID*/, HWND /*hWndCtl*/, BOOL& bHandled)
{
    HRESULT r = m_spWaveRecorder->Recording();  // ActiveX control
    bHandled = TRUE;
    return 0;
}

Calling Recording() should fire a OnStart event. I added an OnStart
handler. Here's the generated sink map entry and my handler.

BEGIN_SINK_MAP(CTest5Ctrl)
    SINK_ENTRY(IDC_MMWAVERECORDERX1, 1, OnStartMmwaverecorderx1)
END_SINK_MAP()

void __stdcall CTest5Ctrl::OnStartMmwaverecorderx1()
{
    // I should get here
}

Now I get the button events. I can step into them and call methods on
the ActiveX controls. I put breakpoints in all of my ActiveX control
event handlers and none of them are entered. I put breakpoints in
BEGIN_SINK_MAP and they are entered upon startup.

I tried Spy++ and I don't see events being fired from the controls but
being new to ATL and Spy++, I don't know if what I'm seeing is normal
or not. I see other events such as mouse movements and clicks, but
nothing unique to the controls.

I have no idea why I'm not getting events from the ActiveX controls.
Any ideas?

Gary F.

7. Getting activex control event from ActiveX control.

8. How to insert the other ActiveX control in my ActiveX control's Di

I build a ActiveX control.there is a event to show a dialog.
BOOL CDemoCtrl::ShowAbout() 
{
	CDialog dlgAbout(IDD_DIALOG1);
	dlgAbout.DoModal();
}
if I placed the normal control on dialog such as "CButton",the Dialog can 
show.
But I placed the other ActiveX control on dialog such as "Flash Control",the 
Dialog can not show. dlgAbout.DoModal() alway return -1.
How can I do?