VBScript Class 
Author Message
 VBScript Class

I'm trying to determine if there is a way in VBScript to programmatically
determine the properties and methods of a VBScript class.

i.e. I've got an ASP page that contains a VBScript class with 5 properties.
I would like to programmatically loop through the properties and display
their values. If I modify the class to have additional properties I would
like to not have to modify the rest of the page to show display the new
properties.

Anyone know if this can be done? and if so any examples or a pointer to an
article would be appreciated.

Thanks
John



Sat, 04 Sep 2004 07:09:29 GMT  
 VBScript Class
Have a look at
http://makeashorterlink.com/?R48A14C8

It's a Microsoft supplied DLL. It gives you access to the interfaces, properties and methods of objects.

Be warned...it is slow. I used it in a VB app once and had to re-write it in C++ as VB was slow...I think it access the registry
alot to get the information.

You may want to look into expando objects (http://www.sellsbrothers.com/tools/default.aspx)  where the properties are not fixed.

Quote:

> I'm trying to determine if there is a way in VBScript to programmatically
> determine the properties and methods of a VBScript class.

> i.e. I've got an ASP page that contains a VBScript class with 5 properties.
> I would like to programmatically loop through the properties and display
> their values. If I modify the class to have additional properties I would
> like to not have to modify the rest of the page to show display the new
> properties.

> Anyone know if this can be done? and if so any examples or a pointer to an
> article would be appreciated.

> Thanks
> John



Sat, 04 Sep 2004 07:53:36 GMT  
 VBScript Class
Just thinking about it abit further...could yyou not use a Dictionary object

From MSDN....
Dim d   ' Create a variable.
Set d = CreateObject("Scripting.Dictionary")
d.Add "a", "Athens"   ' Add some keys and items.
d.Add "b", "Belgrade"
d.Add "c", "Cairo"

Then just make you properties use the dictionary to get their values...sounds alot easier than using TLBINF32.DLL

Vince

Quote:

> Have a look at
> http://makeashorterlink.com/?R48A14C8

> It's a Microsoft supplied DLL. It gives you access to the interfaces, properties and methods of objects.

> Be warned...it is slow. I used it in a VB app once and had to re-write it in C++ as VB was slow...I think it access the registry
> alot to get the information.

> You may want to look into expando objects (http://www.sellsbrothers.com/tools/default.aspx)  where the properties are not fixed.


> > I'm trying to determine if there is a way in VBScript to programmatically
> > determine the properties and methods of a VBScript class.

> > i.e. I've got an ASP page that contains a VBScript class with 5 properties.
> > I would like to programmatically loop through the properties and display
> > their values. If I modify the class to have additional properties I would
> > like to not have to modify the rest of the page to show display the new
> > properties.

> > Anyone know if this can be done? and if so any examples or a pointer to an
> > article would be appreciated.

> > Thanks
> > John



Sat, 04 Sep 2004 08:09:14 GMT  
 VBScript Class
Surely that's tlbinfo is not going to help with a script class?
Joe

Quote:
> Just thinking about it abit further...could yyou not use a Dictionary
object

> From MSDN....
> Dim d   ' Create a variable.
> Set d = CreateObject("Scripting.Dictionary")
> d.Add "a", "Athens"   ' Add some keys and items.
> d.Add "b", "Belgrade"
> d.Add "c", "Cairo"

> Then just make you properties use the dictionary to get their

values...sounds alot easier than using TLBINF32.DLL
Quote:

> Vince




Quote:
> > Have a look at
> > http://makeashorterlink.com/?R48A14C8

> > It's a Microsoft supplied DLL. It gives you access to the interfaces,

properties and methods of objects.
Quote:

> > Be warned...it is slow. I used it in a VB app once and had to re-write

it in C++ as VB was slow...I think it access the registry
Quote:
> > alot to get the information.

> > You may want to look into expando objects

(http://www.sellsbrothers.com/tools/default.aspx)  where the properties are
not fixed.
Quote:




Quote:
> > > I'm trying to determine if there is a way in VBScript to
programmatically
> > > determine the properties and methods of a VBScript class.

> > > i.e. I've got an ASP page that contains a VBScript class with 5
properties.
> > > I would like to programmatically loop through the properties and
display
> > > their values. If I modify the class to have additional properties I
would
> > > like to not have to modify the rest of the page to show display the
new
> > > properties.

> > > Anyone know if this can be done? and if so any examples or a pointer
to an
> > > article would be appreciated.

> > > Thanks
> > > John



Sat, 04 Sep 2004 16:59:49 GMT  
 VBScript Class
And that's not TLBINF32.DLL, that's the help file for it...which you can't download anyway unless you are a registered owner of Visual Basic.

: Surely that's tlbinfo is not going to help with a script class?
: Joe

: > Just thinking about it abit further...could yyou not use a Dictionary
: object
: >
: > From MSDN....
: > Dim d   ' Create a variable.
: > Set d = CreateObject("Scripting.Dictionary")
: > d.Add "a", "Athens"   ' Add some keys and items.
: > d.Add "b", "Belgrade"
: > d.Add "c", "Cairo"
: >
: > Then just make you properties use the dictionary to get their
: values...sounds alot easier than using TLBINF32.DLL
: >
: > Vince
: >
: >


: > > Have a look at
: > > http://makeashorterlink.com/?R48A14C8
: > >
: > > It's a Microsoft supplied DLL. It gives you access to the interfaces,
: properties and methods of objects.
: > >
: > > Be warned...it is slow. I used it in a VB app once and had to re-write
: it in C++ as VB was slow...I think it access the registry
: > > alot to get the information.
: > >
: > > You may want to look into expando objects
: (http://www.sellsbrothers.com/tools/default.aspx)  where the properties are
: not fixed.
: > >
: > >
: > >


: > > > I'm trying to determine if there is a way in VBScript to
: programmatically
: > > > determine the properties and methods of a VBScript class.
: > > >
: > > > i.e. I've got an ASP page that contains a VBScript class with 5
: properties.
: > > > I would like to programmatically loop through the properties and
: display
: > > > their values. If I modify the class to have additional properties I
: would
: > > > like to not have to modify the rest of the page to show display the
: new
: > > > properties.
: > > >
: > > >
: > > > Anyone know if this can be done? and if so any examples or a pointer
: to an
: > > > article would be appreciated.
: > > >
: > > >
: > > > Thanks
: > > > John
: > > >
: > > >
: > >
: > >
: >
: >
:
:



Sat, 04 Sep 2004 17:29:17 GMT  
 VBScript Class
tlbinfo.dll comes with Visual Studio. All you need is the help file to tell you what to do with the thing!

Admitidly I may have read the question wrong....it was very late!


And that's not TLBINF32.DLL, that's the help file for it...which you can't download anyway unless you are a registered owner of
Visual Basic.

: Surely that's tlbinfo is not going to help with a script class?
: Joe

: > Just thinking about it abit further...could yyou not use a Dictionary
: object
: >
: > From MSDN....
: > Dim d   ' Create a variable.
: > Set d = CreateObject("Scripting.Dictionary")
: > d.Add "a", "Athens"   ' Add some keys and items.
: > d.Add "b", "Belgrade"
: > d.Add "c", "Cairo"
: >
: > Then just make you properties use the dictionary to get their
: values...sounds alot easier than using TLBINF32.DLL
: >
: > Vince
: >
: >


: > > Have a look at
: > > http://makeashorterlink.com/?R48A14C8
: > >
: > > It's a Microsoft supplied DLL. It gives you access to the interfaces,
: properties and methods of objects.
: > >
: > > Be warned...it is slow. I used it in a VB app once and had to re-write
: it in C++ as VB was slow...I think it access the registry
: > > alot to get the information.
: > >
: > > You may want to look into expando objects
: (http://www.sellsbrothers.com/tools/default.aspx)  where the properties are
: not fixed.
: > >
: > >
: > >


: > > > I'm trying to determine if there is a way in VBScript to
: programmatically
: > > > determine the properties and methods of a VBScript class.
: > > >
: > > > i.e. I've got an ASP page that contains a VBScript class with 5
: properties.
: > > > I would like to programmatically loop through the properties and
: display
: > > > their values. If I modify the class to have additional properties I
: would
: > > > like to not have to modify the rest of the page to show display the
: new
: > > > properties.
: > > >
: > > >
: > > > Anyone know if this can be done? and if so any examples or a pointer
: to an
: > > > article would be appreciated.
: > > >
: > > >
: > > > Thanks
: > > > John
: > > >
: > > >
: > >
: > >
: >
: >
:
:



Sat, 04 Sep 2004 17:36:50 GMT  
 VBScript Class
Unlike a JavaScript object, you can't enumerate the interface members of an instance of a VBScript class, at least not with script.  To do this you would probably need to use low level COM api calls...

--
Michael Harris
Microsoft.MVP.Scripting
Seattle WA US
--

Quote:

> I'm trying to determine if there is a way in VBScript to programmatically
> determine the properties and methods of a VBScript class.

> i.e. I've got an ASP page that contains a VBScript class with 5 properties.
> I would like to programmatically loop through the properties and display
> their values. If I modify the class to have additional properties I would
> like to not have to modify the rest of the page to show display the new
> properties.

> Anyone know if this can be done? and if so any examples or a pointer to an
> article would be appreciated.

> Thanks
> John



Sat, 04 Sep 2004 22:56:08 GMT  
 VBScript Class
Michael,
Thank you.
That is the answer I was looking for, not the one I wanted hear but
definately the answer I needed.

Thanks again.

John Stemper


Unlike a JavaScript object, you can't enumerate the interface members of an
instance of a VBScript class, at least not with script.  To do this you
would probably need to use low level COM api calls...

--
Michael Harris
Microsoft.MVP.Scripting
Seattle WA US
--


Quote:
> I'm trying to determine if there is a way in VBScript to programmatically
> determine the properties and methods of a VBScript class.

> i.e. I've got an ASP page that contains a VBScript class with 5
properties.
> I would like to programmatically loop through the properties and display
> their values. If I modify the class to have additional properties I would
> like to not have to modify the rest of the page to show display the new
> properties.

> Anyone know if this can be done? and if so any examples or a pointer to an
> article would be appreciated.

> Thanks
> John



Sat, 04 Sep 2004 23:43:15 GMT  
 
 [ 8 post ] 

 Relevant Pages 

1. Threads and Databases (DAO)

2. Any problems with VBScript class containing another class?

3. How to create collection in VBScript, precisely in a vbscript class

4. How to create collection in VBScript, precisely in a vbscript class

5. Need help connecting with an Access database

6. Local Aliases (TDatabase)

7. Emergency - Thread or Cache problem with Paradox

8. Printing Paradox Table Structures

9. Using TImage to read/write bitmaps from Oracle

10. need fix for no mouse with NT

11. input and outpur at pascal

12. CMOS?

 

 
Powered by phpBB® Forum Software