• Welcome to Valhalla Legends Archive.
 

Properties of a Control

Started by Imperceptus, May 26, 2006, 04:14 PM

Previous topic - Next topic

Imperceptus

Is there any way to use a For loop to retrieve all the properties of a control?  Maybe something to the extent of ...

For each property in control
  debug.print property.name
next property


Ive tried a few different ways and I am not gaining any ground.

-thanks
Quote from: Hazard on August 07, 2003, 03:15 PM
Highlight your entire code. Press the delete key. Start over again using Cuphead's CSB tutorial and work your way from their rather than raping code from downloaded sources meant purely for learning purposes. If this does not fix the problem, uninstall Visual Basic and get a new hobby. I suggest Cricket.

topaz

Why would you need to do that? The Visual Basic IDE already provides a list of the properties.
RLY...?

Imperceptus

was just an idea, was curious as to how it would be done if possible... real bored.
Quote from: Hazard on August 07, 2003, 03:15 PM
Highlight your entire code. Press the delete key. Start over again using Cuphead's CSB tutorial and work your way from their rather than raping code from downloaded sources meant purely for learning purposes. If this does not fix the problem, uninstall Visual Basic and get a new hobby. I suggest Cricket.

Grok

Quote from: Imperceptus on May 26, 2006, 04:14 PM
Is there any way to use a For loop to retrieve all the properties of a control?  Maybe something to the extent of ...

For each property in control
  debug.print property.name
next property


Ive tried a few different ways and I am not gaining any ground.

-thanks

Yes, but you will need some help from COM programming.  What the VB IDE is doing is using a callback function that queries the interface provided by the control.  The functions/properties list is the interface.  Go to MSDN and look for COM, QueryInterface and start reading.  Chances are you're not that interested.

MyndFyre

Quote from: Grok on May 30, 2006, 01:05 AM
Yes, but you will need some help from COM programming.  What the VB IDE is doing is using a callback function that queries the interface provided by the control.  The functions/properties list is the interface.  Go to MSDN and look for COM, QueryInterface and start reading.  Chances are you're not that interested.
Hey thanks Grok.  I didn't realize that all VB's controls were COM controls.

If you're just interested in doing this with arbitrary code, Visual Basic .NET supports this through the Type class.  Very handy.  :)
QuoteEvery generation of humans believed it had all the answers it needed, except for a few mysteries they assumed would be solved at any moment. And they all believed their ancestors were simplistic and deluded. What are the odds that you are the first generation of humans who will understand reality?

After 3 years, it's on the horizon.  The new JinxBot, and BN#, the managed Battle.net Client library.

Quote from: chyea on January 16, 2009, 05:05 PM
You've just located global warming.

Clan CDH

i'd hate to bump this topic but i just wanted people to know that the reason all the controls are COM because VB6 relies on the DCOM service to start

MyndFyre

Quote from: Clan CDH on July 24, 2006, 08:49 PM
i'd hate to bump this topic but i just wanted people to know that the reason all the controls are COM because VB6 relies on the DCOM service to start

I doubt that that's the reason.  It may be a result, but I'm also not sold on that.
QuoteEvery generation of humans believed it had all the answers it needed, except for a few mysteries they assumed would be solved at any moment. And they all believed their ancestors were simplistic and deluded. What are the odds that you are the first generation of humans who will understand reality?

After 3 years, it's on the horizon.  The new JinxBot, and BN#, the managed Battle.net Client library.

Quote from: chyea on January 16, 2009, 05:05 PM
You've just located global warming.

TheMinistered

There is a activex dll packaged with visual basic that makes reading the interfaces much easier.  You WILL HAVE TO READ THE INTERFACE if you want to get the property names.

Goto Project->References and Select Typelib Information.  You might want to read up on this a bit first.  I use this to determine wether an activex dll plugin supports the proper interfaces before I try to load it.  Most people who enumerate a dir just try to load each dll and catch the error, but I check for the interfaces first.