Article View: alt.support.programming
Article #8Re: Need help with OCX prog in VB
From: Stephen Ellis
Date: Sat, 09 Mar 2002 06:29
Date: Sat, 09 Mar 2002 06:29
53 lines
3610 bytes
3610 bytes
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" <benmarty@tcq.net> wrote in message news:a650u5020un@enews2.newsguy.com... > "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:
<1015655395.11601.0@iapetus.uk.clara.net>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!supernews.com!news.tele.dk!small.news.tele.dk!212.74.64.35!colt.net!newspeer.clara.net!news.clara.net!iapetusReferences:
<1015380151.10159.0@eos.uk.clara.net> <a650u5020un@enews2.newsguy.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 108717,3fb716948e2ce0c0 X-Google-Attributes: gid108717,public X-Google-Thread: 111027,3fb716948e2ce0c0 X-Google-Attributes: gid111027,public X-Google-Thread: 10a78a,3fb716948e2ce0c0 X-Google-Attributes: gid10a78a,public X-Google-ArrivalTime: 2002-03-08 22:30:01 PST Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!supernews.com!news.tele.dk!small.news.tele.dk!212.74.64.35!colt.net!newspeer.clara.net!news.clara.net!iapetus From: "Stephen Ellis" <sellisuk@freeuk.com> Newsgroups: alt.support.programming,comp.programming,fj.questions.programming References: <1015380151.10159.0@eos.uk.clara.net> <a650u5020un@enews2.newsguy.com> Subject: Re: Need help with OCX prog in VB Date: Sat, 9 Mar 2002 06:29:40 -0000 Lines: 55 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.00.2919.6600 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6600 X-Complaints-To: abuse@clara.net (please include full headers) X-Trace: 43a1d300e92613027295315023140142e233e362299f336e043030343c89abe3 NNTP-Posting-Date: Sat, 09 Mar 2002 06:29:55 GMT Message-ID: <1015655395.11601.0@iapetus.uk.clara.net> Lines: 55