Thread View: alt.support.programming
3 messages
3 total messages
Started by Stephen Ellis
Wed, 06 Mar 2002 02:02
Need help with OCX prog in VB
Author: Stephen Ellis
Date: Wed, 06 Mar 2002 02:02
Date: Wed, 06 Mar 2002 02:02
10 lines
1507 bytes
1507 bytes
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.
Re: Need help with OCX prog in VB
Author: Benjamin Marty
Date: Wed, 06 Mar 2002 12:12
Date: Wed, 06 Mar 2002 12:12
36 lines
2747 bytes
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?
Re: Need help with OCX prog in VB
Author: 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? > >
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads