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

Need help with OCX prog in VB

0 views
Skip to first unread message

Stephen Ellis

unread,
Mar 5, 2002, 9:02:19 PM3/5/02
to
HELP!

I need to read information about what forms are running in a program which
uses the OCX i am developing. MS support is crap, article Q138069 which
seems the closest doesn't work! Can anyone give me an insight?

If i use Forms.Count on a form it supplies the info, but if i call
Forms.Count from within my OCX it returns 0. Why? How can I get aronud this?

Stephen Ellis.

Benjamin Marty

unread,
Mar 6, 2002, 7:12:37 AM3/6/02
to
"Stephen Ellis" <sell...@freeuk.com> wrote in message
news:101538015...@eos.uk.clara.net...

OCXes should maybe not be quite so VB-specific (what if the control were
instantiated on an HTML page?). If you need it to be so VB-specific,
perhaps it should be an ActiveX designer (but that would have to be
written with Visual C/C++) or a VB Add-in (but that would, I think, be
only usable at design time). The other option is sticking with an OCX
and having the source code pass information to the OCX about running
forms via the control's methods and properties. Keep in mind that
ActiveX controls are (I think) supposed to be pretty much self-contained
units. If you need something that interacts at a higher level, you'll
probably either need to separate the layers (pass info back and forth
accross the boundary via methods and properties) or switch to another
technology designed for this kind of thing.

I haven't dealt a *whole* lot with VB-created OCX controls so I can't be
sure these are the only answers, but it might give you some ideas (I
remember running into similar limitations myself).

--
Ben Marty BlueM...@email.com
http://gamedev.sf.net/
GCS d+ s a- C++$ UL P+ L+>++ E- W++$>++ N++ o? K? w++$>-- !O M- V- PS(+)
!PE Y PGP- t+ 5 X+ R tv+ b+(-) DI(+) D--- G>++ e++ h-- !r?>+++ y?


Stephen Ellis

unread,
Mar 9, 2002, 1:29:40 AM3/9/02
to
The OCX will only run within a VB or VC application. Even though it is
possible to pass a form count or form details to the OCX, the references
don't exist for the control, just the forms on which the control is based,
therefore an error is returned upon referencing it!

Guess there's just no way of doing it. Seems funny though that you can
reference the direct form above the OCX with the Parent object, just no
other forms (like with the [Globals] object).

Cheers anyway. ;o)

Stephen Ellis.

"Benjamin Marty" <benm...@tcq.net> wrote in message
news:a650u...@enews2.newsguy.com...

0 new messages