Problem with Composite Control containing a Full Control 
Author Message
 Problem with Composite Control containing a Full Control

Hi,

I've developed an ATL Full Control that wraps a Standard
Windows Edit control and acts just like the VB TextBox
with the difference that it has some more features.

In the Edit control's WM_MOUSEACTIVATE handler, I'm in-
place-activating it.

So far, so good - the Full Control works perfectly on a
VB form and even as a child control in a self-developed
ATL Frame Control which uses SimpleFrame functionality
and that acts just like the VB Frame Control.

With "functions perfectly" I mean: it gets the focus
correctly und it can handle its accelerators in
TranslateAccelerator (e. g. Cursor keys) method.

But, here's the problem:
If I add this Edit Full Control to an ATL Composite
control, compile it and place this composite control an a
VB form, there's some strange stuff going on, meaning:

- When I click into the Edit control, it gets focus only
after some short lack of time (this is the first strange
issue).

- I then type some text and activate another control on
the VB parent form, so my control loses focus. In this
moment, the other control gets focus as expected, but my
control still seems to have the caret (not blinking, just
a static black line - painting bug?!).

- If I then give focus back to my control by clicking,
the text in the control simply disappears, meaning the
text is still there, but not painted.

If I give focus to my control by the Tab key, everything
works fine.

Did anybody already have that problem?
Any help is appreciated!

I spent hours on searching for samples, but I didn't find
anything that reflects the situation I have.

Oh, I'm using Visual C++ 6.0 and ATL 3.0

Thx
PhreekySicko



Mon, 05 Sep 2005 18:12:03 GMT  
 Problem with Composite Control containing a Full Control
hi,

i've experienced this with VB created controls, too. the problem seems to be
with the particular ATL implementation of activation. my VB code was based
(heavily) on a snippet from ATL (same code found in MFC) that handled
negotiation of the IOleInPlaceActiveObject interface implementation on the
control side.

check this: add a usercontrol in a VB project and place your control on the
usercontrol. now, place this usercontrol on a VB form and in design-time
click on your ATL control (inside the VB usercontrol). my experience is that
it gets activated (focused) and it should not! i guess ATL is not figuring
out correctly when the control is in design vs run-time. technically the ATL
control is in run-time though the VB IDE is in design-time :-))

anyway, my quick&dirty fix was to call pOleObject.DoVerb OLEIVERB_UIACTIVATE
right after pOleInPlaceFrame.SetActiveObject. it's not perfect but still
alleviated the problem somehow.

HTH,
</wqw>
p.s. i'd love to take a look at your ATL impl of VB Frame control. i'm
interested in the controls containment part.


Quote:
> Hi,

> I've developed an ATL Full Control that wraps a Standard
> Windows Edit control and acts just like the VB TextBox
> with the difference that it has some more features.

> In the Edit control's WM_MOUSEACTIVATE handler, I'm in-
> place-activating it.

> So far, so good - the Full Control works perfectly on a
> VB form and even as a child control in a self-developed
> ATL Frame Control which uses SimpleFrame functionality
> and that acts just like the VB Frame Control.

> With "functions perfectly" I mean: it gets the focus
> correctly und it can handle its accelerators in
> TranslateAccelerator (e. g. Cursor keys) method.

> But, here's the problem:
> If I add this Edit Full Control to an ATL Composite
> control, compile it and place this composite control an a
> VB form, there's some strange stuff going on, meaning:

> - When I click into the Edit control, it gets focus only
> after some short lack of time (this is the first strange
> issue).

> - I then type some text and activate another control on
> the VB parent form, so my control loses focus. In this
> moment, the other control gets focus as expected, but my
> control still seems to have the caret (not blinking, just
> a static black line - painting bug?!).

> - If I then give focus back to my control by clicking,
> the text in the control simply disappears, meaning the
> text is still there, but not painted.

> If I give focus to my control by the Tab key, everything
> works fine.

> Did anybody already have that problem?
> Any help is appreciated!

> I spent hours on searching for samples, but I didn't find
> anything that reflects the situation I have.

> Oh, I'm using Visual C++ 6.0 and ATL 3.0

> Thx
> PhreekySicko



Mon, 05 Sep 2005 20:43:56 GMT  
 Problem with Composite Control containing a Full Control
I have seen this problem in many forms and to me it is a VB bug.

Do a simple thing:

- Make a VB control that hosts a WebBrowser.

- Host that control in a VB Form.

- Navigate to e local WordDocument.doc file on your HD.

Same problem, No ATL involved.

It is as if a 3-rd (and up) generation ActiveX will have this problem.

All 3 generations in ATL or ATL/MFC or ATL/MFC/WebBrowser works fine. so the
obvious bad guy is VB...?


Quote:
> Hi,

> I've developed an ATL Full Control that wraps a Standard
> Windows Edit control and acts just like the VB TextBox
> with the difference that it has some more features.

> In the Edit control's WM_MOUSEACTIVATE handler, I'm in-
> place-activating it.

> So far, so good - the Full Control works perfectly on a
> VB form and even as a child control in a self-developed
> ATL Frame Control which uses SimpleFrame functionality
> and that acts just like the VB Frame Control.

> With "functions perfectly" I mean: it gets the focus
> correctly und it can handle its accelerators in
> TranslateAccelerator (e. g. Cursor keys) method.

> But, here's the problem:
> If I add this Edit Full Control to an ATL Composite
> control, compile it and place this composite control an a
> VB form, there's some strange stuff going on, meaning:

> - When I click into the Edit control, it gets focus only
> after some short lack of time (this is the first strange
> issue).

> - I then type some text and activate another control on
> the VB parent form, so my control loses focus. In this
> moment, the other control gets focus as expected, but my
> control still seems to have the caret (not blinking, just
> a static black line - painting bug?!).

> - If I then give focus back to my control by clicking,
> the text in the control simply disappears, meaning the
> text is still there, but not painted.

> If I give focus to my control by the Tab key, everything
> works fine.

> Did anybody already have that problem?
> Any help is appreciated!

> I spent hours on searching for samples, but I didn't find
> anything that reflects the situation I have.

> Oh, I'm using Visual C++ 6.0 and ATL 3.0

> Thx
> PhreekySicko



Fri, 09 Sep 2005 23:50:40 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. ATL Full Control - mouse activation problems in Composite Control

2. ATL Full Control - mouse activation problems in Composite Control

3. How to invoke methods of contained ActiveX control from ATL Composite Control

4. Z -order between contained controls inside a composite control

5. Controling contained control from Composite Control

6. composite controls: protection from UNregistered contained controls

7. Initialize a Full Control in a browser from a Composite Control

8. Full control vs. Composite control

9. Problems with ATL Full control that contains a ComboBox

10. A composite control calling another composite control in web browser

11. Composite control hosted by a composite control.

12. Using Rich Edit Control or ip address control in a composite control

 

 
Powered by phpBB® Forum Software