Discussion:
List all enumerations.
(too old to reply)
Olivier BESSON
2006-06-06 15:37:48 UTC
Permalink
Hello,

I'm looking in the object model for a way to list all of my project
enumerations class by class or if it's not possible all enumerations
accessibles in the project.
By now i've founded no other way to do this excep by parsing code line by
line (not very good and secure).

Can someone help me with this.

(i'm doing an addin to make the same thing like the class generator but with
code normalised to my company rules).

Thanks in advance.

Olivier
Ralph
2006-06-06 21:35:16 UTC
Permalink
Post by Olivier BESSON
Hello,
I'm looking in the object model for a way to list all of my project
enumerations class by class or if it's not possible all enumerations
accessibles in the project.
By now i've founded no other way to do this excep by parsing code line by
line (not very good and secure).
Can someone help me with this.
(i'm doing an addin to make the same thing like the class generator but with
code normalised to my company rules).
Thanks in advance.
Olivier
I am not sure I understand what you are trying to do (static, runtime?).

But if you are attempting to enforce 'Company Rules' why not take a look at
removing Enums (and other defines as well) from your code and use type
libraries instead.

http://www.devx.com/vb2themax/Article/19830/1763/page/1
http://support.microsoft.com/kb/189133/EN-US/
http://support.microsoft.com/kb/143258/EN-US/
http://www.devx.com/vb2themax/Article/19830
http://www.vbaccelerator.com/home/VB/Type_Libraries/index.asp?page=1

Also you may want to take a look at a free download MZTools
(www.mztools.com) which will parse projects and gleam a great deal of
information and output handy html.

-ralph
Olivier BESSON
2006-06-07 08:09:04 UTC
Permalink
Hello,

Thanks for your response.

I know MZTools and i've bought .NET versions of this. I've asked it's
creator for this and he only parse code lines for enums.
What i want to do is a class constructor addin (like the vb6 class wizard)
to create and modify classes of my projects. For this i must have something
for exemple to list all enumerations and the differents values.

Since yesterday, i've found tlbInf32.dll that can get information from files
or objects but i'm actually bloqued with the way of querying class,
properties, etc ... of the active project that may be not saved on the disk
(when you just created a new project from the ide).

Is there someone that know how to do this ?

Olivier
Post by Ralph
Post by Olivier BESSON
Hello,
I'm looking in the object model for a way to list all of my project
enumerations class by class or if it's not possible all enumerations
accessibles in the project.
By now i've founded no other way to do this excep by parsing code line by
line (not very good and secure).
Can someone help me with this.
(i'm doing an addin to make the same thing like the class generator but
with
Post by Olivier BESSON
code normalised to my company rules).
Thanks in advance.
Olivier
I am not sure I understand what you are trying to do (static, runtime?).
But if you are attempting to enforce 'Company Rules' why not take a look at
removing Enums (and other defines as well) from your code and use type
libraries instead.
http://www.devx.com/vb2themax/Article/19830/1763/page/1
http://support.microsoft.com/kb/189133/EN-US/
http://support.microsoft.com/kb/143258/EN-US/
http://www.devx.com/vb2themax/Article/19830
http://www.vbaccelerator.com/home/VB/Type_Libraries/index.asp?page=1
Also you may want to take a look at a free download MZTools
(www.mztools.com) which will parse projects and gleam a great deal of
information and output handy html.
-ralph
"Peter Huang" [MSFT]
2006-06-08 03:00:11 UTC
Permalink
Hi Olivier,

For a non compile project without typelib or something like that, we have
to leverage the VB IDE object modal.
Here is a link for your reference.
Extensibility Object Model Language Reference
http://msdn.microsoft.com/archive/default.asp?url=/archive/en-us/office97/ht
ml/output/F1/D6/S5B446.asp

But that Object Modal did not expose such an interface for enumerations.

So I think you may have to parse the code by your self.

If you still have any concern, please feel free to post here.

Best regards,

Peter Huang

Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
Loading...