Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

vb6 designer compatible container control

12 views
Skip to first unread message

Tobias Käs

unread,
Oct 30, 2009, 4:59:52 AM10/30/09
to
I've been searching for some way to create something like a vb6
UserControl/PictureBox/Frame with ATL, that is a control which can
contain other controls. Unlike an ATL composite control it should
support placing controls in the vb designer.

From my research in the net I could only find examples for top-level
containers. In the docs there don't seem to be any interfaces I could
implement which tell me when controls are added/removed so I suppose
they are vb-specific.

Does there exist any documentation on interacting with the vb
designer? Are there any examples of ActiveX TabControls, GroupBoxes or
whatever written in C/C++ ? Or do all controls supporting the vb
designer have to be written in vb themselves as UserControls?

Regards,
Tobias Käs

Timo Kunze

unread,
Oct 30, 2009, 5:56:45 AM10/30/09
to
In IOleObject_SetClientSite, you must query the client site for
ISimpleFrameSite. Then the control's message map must be extended so
that it calls ISimpleFrameSite::PreMessageFilter and
ISimpleFrameSite::PostMessageFilter. You also must set the
OLEMISC_SIMPLEFRAME flag.

Timo
--
www.TimoSoft-Software.de - Unicode controls for VB6
"Those who sacrifice freedom for safety deserve neither."
"Demokratie ist per Definition unsicher. Ihr Schutz entsteht aus der
Überzeugung, dass die demokratischen Kräfte überwiegen und sich – auf
demokratischem Wege – durchsetzen."

Tobias Käs

unread,
Oct 30, 2009, 10:13:13 AM10/30/09
to
On 30 Okt., 10:56, Timo Kunze <TKunze71...@gmx.de> wrote:
> In IOleObject_SetClientSite, you must query the client site for
> ISimpleFrameSite. Then the control's message map must be extended so
> that it calls ISimpleFrameSite::PreMessageFilter and
> ISimpleFrameSite::PostMessageFilter. You also must set the
> OLEMISC_SIMPLEFRAME flag.

Ah thanks, this does what I need for now.

Out of curiosity, is this the only way to create composite controls
with designer support? The interface name ('simple') suggests there
should be something else. There also seems to be no way to get a list
of child controls like the VB UserControl can do, which would be
necessary for implementing more complicated containers like
TabControls.

Timo Kunze

unread,
Oct 30, 2009, 10:33:20 AM10/30/09
to

My knowledge about container controls is limited. You don't find much
about it on the web. I don't know the answers to your questions, sorry.

Tobias Käs

unread,
Oct 31, 2009, 2:39:10 PM10/31/09
to
On 30 Okt., 15:33, Timo Kunze <TKunze71...@gmx.de> wrote:
> My knowledge about container controls is limited. You don't find much
> about it on the web. I don't know the answers to your questions, sorry.

No problem, just was curious, simple containers are just fine for me,
thanks for pointing me in the right direction.

By the way, I've found the very well hidden interface IVBGetControl
from vbinterf.h ( http://msdn.microsoft.com/en-us/library/dd542712%28VS.85%29.aspx
) - it's deprecated and does something similar as
IOleContainer::EnumObjects but allows to enumerate children and
siblings instead of just all objects. However in my test application
both interfaces didn't list some controls like labels or buttons so
the interfaces are probably useless for implementations of TabControls
and the like.

0 new messages