From: mr_unreliable on


mayayana wrote:
> Getting code guidance from a
> COM type library viewer is like trying to drive using
> a map that marks cities and towns but not roads.
> The type library only documents the structure of function
> calls. It serves best as a crib sheet for people who
> already know how to use a given object.
>
Well, yes and no. It depends.

Generally speaking, the names of the methods and properties
are named in such as way as to make their use pretty much
transparent.

Yes, I have run across methods and properties (and parameters)
that were inscrutable, and yes having the documentation is
highly desirable, but the situation is not quite as bleak
as you characterized it.

For example, there are some really helpful coders out there.
Take Steve McMahon, here are a couple of samples of one of his
control's event code, and a function (i.e., a property of his
treeview control):

--- <snip> ---
Public Event CustomSort(node1 As cTreeViewNode, node2 As cTreeViewNode,
nodeParent As cTreeViewNode, ByRef iCompareResult As ETreeViewSortResult)
Attribute CustomSort.VB_Description = "Raised when the children of a
node need to be sorted and the sort mode has been set to custom."

Public Property Get DragStyle() As ETreeViewDragInsertStyle
Attribute DragStyle.VB_Description = "Gets/sets the drag style for the
control. In insert mode, the order of children can be modified, whereas
in drop-highlight mode only an item's parent can be changed."
DragStyle = m_eDragStyle
End Property
--- </snip> ---

What that "Attribute CustomSort.VB_Description" and "Attribute
DragStyle.VB_Description" amount to is "self-documentation".
That VB_Description text is included in the typedef, and if you
use a typedef viewer such as Steve's own ActX Documenter utility,
then you will see that text along with the event's, or method's
or property's name and parameters. In the case of his treeview
control, Steve has taken the time to self-documented (nearly) all
the methods and properties. And so, the output from his ActX
Documenter utility _IS_ the formal documentation.

I believe that microsoft is doing this. If you look at the
microsoft controls and application objects in the vb object
browser, you will see little helpful discriptive comments.
Maybe not as helpful and discriptive as you would like, but
still helpful to some degree. I expect that those little
helpful comments are coming out of the typelib.

And yes, not every coder is as conscientious as Steve, (or
microsoft) but it is worth a look to see if the typelib is self-documented.

cheers, jw

p.s. And yes, I agree that those vb.net "objects" found in
the registry are useless to scripters, except in a very few
rare situations.
From: est on
On 3ÔÂ15ÈÕ, ÏÂÎç11ʱ13·Ö, "mayayana" <mayaXXyan...(a)mindXXspring.com> wrote:
> > I will, also, have a looksee at that COM viewer.
> > I've been needing a utility like that for a while.
>
> It will be very frustrating if you don't also have some
> documentation. Alex Angelopoulos looked into this
> awhile back and found a few useful tidbits in .Net, but
> not much. If I remember correctly he found a useful
> array object. (Or maybe it's the Collection object
> in the list posted here.) In any case, you might save
> more time in the long run if you search for information
> that others have already found. (And you might be able
> to find Alex's post with a usenet search.) I'd guess that
> the vast majority of the objects in that COM-compatible
> "dump" of .Net objects will serve no useful purpose.


Maybe the Canlendar objects and MD5, base64 objects are useful. I
tried base64 using .NET, but I cannot construct a bytearray object.
Can you help?


> Getting code guidance from a
> COM type library viewer is like trying to drive using
> a map that marks cities and towns but not roads.
> The type library only documents the structure of function
> calls. It serves best as a crib sheet for people who
> already know how to use a given object.





From: mayayana on

>
Maybe the Canlendar objects and MD5, base64 objects are useful. I
tried base64 using .NET, but I cannot construct a bytearray object.
Can you help?
>

Sorry but I'm not familiar with .Net objects and I
don't have any of the runtimes installed. You can
do Base64 conversion in straight VBS, if that helps.
(See here:
http://www.jsware.net/jsware/scripts.php3#bints )

I don't know about the other two. Maybe someone
else will.

I did come across the object mentioned by Alex A.,
though. It's the ArrayList, mentioned here:
http://msdn2.microsoft.com/en-us/library/h8k45y06.aspx