Click here to Skip to main content
15,903,388 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i am developing a project in vb6.backend is sql. i want to get menu names and form names in the project and save it in the database.

i want to assign rights to the forms depending upon the user logon.

can any one give the code to get .

S.Selvaraj
Posted
Updated 29-Jan-10 23:21pm

1 solution

I can't "give the code", but short of just manually making a list of them and manually inserting the info into the db, I would write another program that uses reflection to retrieve a list of objects that are derived from or of type Form and MenuItem, and then insert them into the DB.

The reason I highlighted "write another program" is because you don't want to include this kind of code in your production (deployed) application.


I just realized you're talking about VB6. You're gonna have to do it manually. If you were using .Net, this would be possible. BTW, I would think about using resource IDs or manually assigned properties like FormName instead of the actual physical form class names. I'm not sure that you can get form names in unmanaged code (or even if it's a smart move to use such a mechanism because it can be inadvertently changed in the form designer), but I'm pretty sure that every window and control in that window has a numeric resource ID of some kind.
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900