Listing Non-Visual Component Names at Runtime

Tech-Archive recommends: Fix windows errors by optimizing your registry



Hi,

I have a number of non-visual components which I am trying to get the
name of at run time.

I have managed to reference each component using the following:

Dim pf As Type

pf = f.GetType
Dim fi As FieldInfo = pf.GetField("components",
BindingFlags.Instance Or BindingFlags.NonPublic)
' Dim o As Object =
Dim cl As IContainer = CType(fi.GetValue(f), IContainer)
Dim cm As Component

For Each cm In cl.Components
... etc

The cm.name gives me the type name of the object whereas I need the
actual name that the uer entered.

Am I going about this the correct way, is it possible to get this
info?

Thanks in advance

.



Relevant Pages

  • RE: Listing Non-Visual Component Names at Runtime
    ... runtime and I don't see it with reflection. ... Dim pf As Type ... Dim fi As FieldInfo = pf.GetField("components", ... Dim cl As IContainer = CType, ...
    (microsoft.public.dotnet.framework)
  • RE: open arguments.
    ... The original to add a complete new quote, one to edit a quote and one to ... Dim rst As Recordset ... This opens the form specified by stDocName in data entry mode and passes the ... You want to store your reference so poke it into the reference field. ...
    (microsoft.public.access.modulesdaovba)
  • RE: open arguments.
    ... Dim rst As DAO.Recordset ... Just realised there is an Access object called Reference. ... This opens the form specified by stDocName in data entry mode and passes the ...
    (microsoft.public.access.modulesdaovba)
  • RE: open arguments.
    ... Dim dbs As DAO.Database ... Dim rst As DAO.Recordset ... Just realised there is an Access object called Reference. ... This opens the form specified by stDocName in data entry mode and passes the ...
    (microsoft.public.access.modulesdaovba)
  • Re: VS2005 vb.net DLL - interop EXCEL
    ... where you are actually working with Excel via ComInterOp is ... ..NET CLR to release it's reference to the underlying COM object: ... Dim xlAppl As Excel.Application ... It has to do some work with Excel files, so I created a DLL in VS2005. ...
    (microsoft.public.dotnet.languages.vb)