Add-In: StaticToolz (Attached in First Post..just for fun)
I HAVE EDITED THIS FIRST POST....and the title... etc...
and attached it..
I know.. strange title.. but here is my question..
it seems like u can tap just about anything in the IDE as long as u know how..
Anyone know how to get the list available Dim as TYPEs?
Like String, Integer, etc... I want to get all of them (well only the CURRENT Available ones...)
Thanks!
(LATEST VERSION: TESTING ONLY! PRE-ALPHA VERSION! lol)
play with it.. make suggestions... break it...
to run..
unzip..
run
start another VB and open a project...
as a suggestion I would make a backup of any project
you play with using this lol
Version -.00874.1.z
Last edited by Static; Dec 9th, 2005 at 04:31 PM.
JPnyc rocks!! (Just ask him!)
If u have your answer please go to the thread tools and click "Mark Thread Resolved"
If you mean standard data types then there are only a few, but there are TONS of different object types. You can Dim a variable as any Object, class, enum, UDT, etc.
Here are all the standard data types that I can think of but I'm sure someone can post a full list:
Byte
Integer
Long
Single
Double
String
Currency
Date
I could get the "List" but I want to exctract it from VBIDE
MZTools can do it...
in the Add Procedure...Look in the datatype... click the FILL button on some of the types.. bam.. it fills the dropdown..
I want to get all of these on my form load (or something) so that when the user types in an var name then As bam.. the list appears..
(Auto filling like in the actual IDE) I know it can be done so I am determined to do it! lol
I am making an addin that will do similar things to MZ but do them better .. more easily used.. more intuitive etc..(plus others)
like my Msgbox creator presents u with a form that looks like a msgbox.. then lets you type in the title, prompt, right click select image, buttons, enter variable name for the return value etc.. really easy to use.. even multiline msgbox using ALT+Enter
JPnyc rocks!! (Just ask him!)
If u have your answer please go to the thread tools and click "Mark Thread Resolved"
To get a full list I think you would need to access the object browser. Either that or access whatever the obeject accesses to get that info. I'm not sure if it would be possible or easy. Is MZTools open source?
To get a full list I think you would need to access the object browser. Either that or access whatever the obeject accesses to get that info. I'm not sure if it would be possible or easy. Is MZTools open source?
If I were you I would take some time to search for a site that has a ton of add-in info. There are always sites out there that are exactly what you need, it usually just takes time.
PSC is a good place to start. Just start skimming their add-in's and take notes on interesting/new things you see.
The thing is, there is a DLL named TLBINF32.DLL. It lives i n "C:\WINDOWS\SYSTEM32"
It seems that the VB Object Browser uses that DLL.
This DLL gives you all, Classes, Contants, Properties...
It needs you to pass a Filename (DLL or OCX, or TLB), as far as I saw, it reads all OCX's, but not all DLL's, seems that it reads some VB DLLs.
This can also read the data if you pass the object, also reads from registry, performs search, well, it does too many things, here Ill post a little example reading from files in a collection.
ADD reference to "Typelib Information", located in: "C:\WINDOWS\SYSTEM32\TLBINF32.DLL"
Add a List (list1) and a Commandbutton (Command1)
VB Code:
Dim mCol As Collection
Private Sub LoadData()
Dim i As Integer
Dim j As Integer
Dim lMember As MemberInfo
Dim lConst As ConstantInfo
Dim tliTypeLibInfo As TypeLibInfo
On Error Resume Next 'Some Libs hasn't data to show and TypeLibInfo fire error
For i = 1 To mCol.Count
Set tliTypeLibInfo = TLI.TypeLibInfoFromFile(mCol.Item(i))
I think that, when you type: DIM ..... AS _____, VB IntelliSense get all the types in MSVBVM60.DLL and ALL the types inside each OCX component you are using in your APP. If you open your Project with NOTEPAD (VBP FILE) you have all that DLL's,TLB's;OCX's listed there, it looks like this:
There you can see: Scripting Runtime, Common Controls, Rich Textbox, flexgrid, Common Dialog... and don't know what else.
MZ TOOLS also takes many things directly from Project files.
jcis.. I just got an email from the people @ MZTools.. they pointed me to the same thing u did. the TypeLibinfo. Im glad I stopped back here before getting to deep into searching! That code is perfect.. I had just found the items in the VBA (MSVBVM60.DLL) file and saw all the "types" was wondering where the other stuff came from.. that is perfect!!
JPnyc rocks!! (Just ask him!)
If u have your answer please go to the thread tools and click "Mark Thread Resolved"
and one more thing.. scanning that list I dont see "objects"
the variable types are easy to spot... vbInteger, vbLong etc..
but where are "Listbox", CommandButton, etc? hmmm....
JPnyc rocks!! (Just ask him!)
If u have your answer please go to the thread tools and click "Mark Thread Resolved"
I have been playing with this some more.. seeing what can be "yanked" out...
taking JCIS's code, I changed a few things and added some so its easier to poke around...
Start a New Project...
Add Ref to TypeLib Information
Add a command Button (Name:Command1)
And a Treeview (Name:TV1)
VB Code:
Dim mCol As Collection
Private Sub LoadData()
Dim i As Integer
Dim j As Integer
Dim lMember As MemberInfo
Dim lConst As ConstantInfo
Dim tliTypeLibInfo As TypeLibInfo
TV1.Nodes.Clear
On Error Resume Next
For i = 1 To mCol.Count
Set tliTypeLibInfo = TLI.TypeLibInfoFromFile(mCol.Item(i))
Nice! I like it.
I think there is all you need to create the Intellisense effect.
And I think Intellisense also list the types in the active OCX components in the project, you're gonna take that from the VBP?
i.e. the rich textbox control, the msflexgrid.. should be added only if the user has it selected in Componets. Else he can select it in your intellisense, and that would fire errors when running code.
Another thing to take care is the version of the components. I have 3 diferent versions of some OCX's. I saw some code that gets the right version from registry I think, 'ill see if I find it.
PictureBox
Label
TextBox
Frame
CommandButton
CheckBox
OptionButton
ComboBox
ListBox
HScrollBar
VScrollBar
Timer
Printer
Form
Screen
Clipboard
DriveListBox
DirListBox
FileListBox
Menu
MDIForm
App
Shape
Line
Image
Data
OLE
UserControl
PropertyPage
UserDocument
Global
VBControlExtender
Empty
Null
Integer
Long
Single
Double
Currency
Date
String
Object
Error
Boolean
Variant
DataObject
Decimal
Byte
UserDefinedType
Array
I cant find the section (file) with Control in it?
Dim ctl as Control
at the moment I am just adding the basics... because this is for a sub/function builder
adding the args... but this "feature" could be used elsewhere (And I plan on it!!)
JPnyc rocks!! (Just ask him!)
If u have your answer please go to the thread tools and click "Mark Thread Resolved"
Remix, you're saying that Collections are faster than arrays unless the array is very large?
I'm not sure that is what you meant, but if that is what you meant, then I am 95% sure you are incorrect. A collection is just a form of an array but each element takes up a lot more space and there is a lot more processing going on for each element. Especially since the "Key" is a variant (and can be a string or the index number).
A couple this I noticed:
1) Youre window for the Procedure formatter is set to always on top of everything instead of just ontop of the IDE. I'm not sure how you would code it to just be on top of the IDE without being modal, but I'm sure there is a way.
2) I have XP styles on in my IDE and anywhere that you use a frame you have to put a picture box ontop of the from otherwise things look like the image attached below.
Other than that things look good. I didn't check too closely though.
Remix, you're saying that Collections are faster than arrays unless the array is very large?
I'm not sure that is what you meant, but if that is what you meant, then I am 95% sure you are incorrect. A collection is just a form of an array but each element takes up a lot more space and there is a lot more processing going on for each element. Especially since the "Key" is a variant (and can be a string or the index number).
Not saying if its a large array, just big enough so you dont have to redim it. Collections are faster if you redim..