🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: alt.support.programming
Article #7

Re: Need help with OCX prog in VB

#7
From: Benjamin Marty
Date: Wed, 06 Mar 2002 12:12
36 lines
2747 bytes
"Stephen Ellis" <sellisuk@freeuk.com> wrote in message
news:1015380151.10159.0@eos.uk.clara.net...
> 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?

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  BlueMonkMN@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?
Technical Details
Message-ID: <a650u5020un@enews2.newsguy.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!pln-w!spln!dex!extra.newsguy.com!newsp.newsguy.com!enews2
References: <1015380151.10159.0@eos.uk.clara.net>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 111027,3fb716948e2ce0c0
X-Google-Attributes: gid111027,public
X-Google-Thread: 108717,3fb716948e2ce0c0
X-Google-Attributes: gid108717,public
X-Google-Thread: 10a78a,3fb716948e2ce0c0
X-Google-Attributes: gid10a78a,public
X-Google-ArrivalTime: 2002-03-06 04:38:28 PST
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!pln-w!spln!dex!extra.newsguy.com!newsp.newsguy.com!enews2
From: "Benjamin Marty" <benmarty@tcq.net>
Newsgroups: alt.support.programming,comp.programming,fj.questions.programming
Subject: Re: Need help with OCX prog in VB
Date: Wed, 6 Mar 2002 06:12:37 -0600
Organization: http://extra.newsguy.com
Lines: 38
Message-ID: <a650u5020un@enews2.newsguy.com>
References: <1015380151.10159.0@eos.uk.clara.net>
NNTP-Posting-Host: p-637.newsdawg.com
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.50.4522.1200
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200