Author Topic: Interogate an object for its ActiveX properties and methods ...  (Read 34654 times)

0 Members and 1 Guest are viewing this topic.

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: Interogate an object for its ActiveX properties and methods ...
« Reply #45 on: November 12, 2007, 02:49:25 PM »
Ok, it took me forever, but I found a reliable / safe source for TLBINF32.DLL for those that might want it.

Visual Studio 6, Service Pack 6.

Said service pack, which manifests itself as a zip executable (Vs6sp6.exe), can be opened via winzip. Vs6sp6.exe hosts cab file VS6SP61.cab, which can also be opened via winzip, which hosts TLBINF32.DLL.

:P
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

Bob Wahr

  • Guest
A question of legality
« Reply #46 on: November 12, 2007, 02:52:35 PM »
Is using a DLL from a CAB, from a service pack for a program that you don't own be a copyright issue with Microsoft?


MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: Interogate an object for its ActiveX properties and methods ...
« Reply #48 on: November 12, 2007, 04:51:10 PM »
Can be downloaded from here:

http://home.wtal.de/ib/freisoft/

http://www.vbaccelerator.com/codelib/actvxdoc/article.htm

and a sample implementation:

http://msdn.microsoft.com/msdnmag/issues/1200/TypeLib/default.aspx

I know you mean well Luis but the dll is not on vbaccelerator's site and do you fully trust the other?

I found dozens of sites that hosted the dll but none I felt comfortable suggesting other than what I previously posted.

Just sayin'.

Is using a DLL from a CAB, from a service pack for a program that you don't own be a copyright issue with Microsoft?

Valid and important question. Sorry, I don't know Bob. It's the only source I felt comfortable suggesting.

{shrug}
« Last Edit: November 12, 2007, 04:55:49 PM by MP »
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

LE

  • Guest
Re: Interogate an object for its ActiveX properties and methods ...
« Reply #49 on: November 12, 2007, 06:07:47 PM »
Yes.... that was an implementation sample too...


About the DLL download area.... I saw a lot of other samples linking to that place.


BTW, I do not have that dll in any of my pc [5]

I have also Visual Studio Pro 6.0 that I do not use anymore and also the VB 6.0 that do not use of have installed... no idea if it is in any of them.

Visual Studio 2005 does not include with that... either
« Last Edit: November 12, 2007, 06:09:17 PM by LE »

Didge

  • Bull Frog
  • Posts: 211
Re: Interogate an object for its ActiveX properties and methods ...
« Reply #50 on: November 13, 2007, 03:09:24 AM »
"Better write a better _FindDLL MP!"

1. What version of Windows?  : Windows XP Pro

2. What version of AutoCAD? : MAP 3D 2006.

3. Have you ever run the VBAIDE? : Only out of curiosity.

4. What path on your machine hosts tlbinf32.dll? : Cannot locate any instance of this file.

5. Do you have Visual Studio 6 installed on an active drive? : No.
Think Slow......

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: Interogate an object for its ActiveX properties and methods ...
« Reply #51 on: November 13, 2007, 07:43:18 AM »
"Better write a better _FindDLL MP!"

...

Thanks Didge, appreciate you taking the time.

BTW, I do not have that dll in any of my pc [5]

I have also Visual Studio Pro 6.0 that I do not use anymore and also the VB 6.0 that do not use of have installed... no idea if it is in any of them.

Visual Studio 2005 does not include with that... either

Lines up with the rest of the reports. Thanks Luis.
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: Interogate an object for its ActiveX properties and methods ...
« Reply #52 on: November 13, 2007, 07:50:29 AM »
This just in:

PROPERTIES

    (PROPERTY VALUE ACCESS VISIBILITY)

    ("CodePane" #<VLA-OBJECT _CodePane 077d6758> READONLY NORMAL)
    ("CountOfDeclarationLines" 1 READONLY NORMAL)
    ("CountOfLines" 7 READONLY NORMAL)
    ("Lines" "<Error: Invalid number of parameters>" READONLY NORMAL)
    ("Name" "ThisDrawing" READWRITE HIDDEN)
    ("Parent" #<VLA-OBJECT _VBComponent 071fb1bc> READONLY NORMAL)
    ("ProcBodyLine" "<Error: Invalid number of parameters>" READONLY NORMAL)
    ("ProcCountLines" "<Error: Invalid number of parameters>" READONLY NORMAL)
    ("ProcOfLine" "<Error: Invalid number of parameters>" READONLY NORMAL)
    ("ProcStartLine" "<Error: Invalid number of parameters>" READONLY NORMAL)
    ("VBE" #<VLA-OBJECT VBE 07361c84> READONLY NORMAL)
   
METHODS   

    (METHOD ARGUMENTS ACCESS)

    ("AddFromFile" (("FileName" STR)) NORMAL)
    ("AddFromString" (("String" STR)) NORMAL)
    ("AddRef" nil RESTRICTED)
    ("CreateEventProc" (("EventName" STR) ("ObjectName" STR)) NORMAL)
    ("DeleteLines" (("StartLine" I4) ("Count" I4 OPTIONAL)) NORMAL)
    ("Find" (("Target" STR) ("StartLine" I4) ("StartColumn" I4) ("EndLine" I4) ("EndColumn" I4) ("WholeWord" BOOL OPTIONAL) ("MatchCase" BOOL OPTIONAL) ("PatternSearch" BOOL OPTIONAL)) NORMAL)

    ("GetIDsOfNames" (("riid" EMPTY) ("rgszNames" I1) ("cNames" UINT) ("lcid" UI4) ("rgdispid" I4)) RESTRICTED)
    ("GetTypeInfo" (("itinfo" UINT) ("lcid" UI4) ("pptinfo" VOID)) RESTRICTED)
    ("GetTypeInfoCount" (("pctinfo" UINT)) RESTRICTED)
    ("InsertLines" (("Line" I4) ("String" STR)) NORMAL)
    ("Invoke" (("dispidMember" I4) ("riid" EMPTY) ("lcid" UI4) ("wFlags" UI2) ("pdispparams" EMPTY) ("pvarResult" variant) ("pexcepinfo" EMPTY) ("puArgErr" UINT)) RESTRICTED)
    ("QueryInterface" (("riid" EMPTY) ("ppvObj" VOID)) RESTRICTED)
    ("Release" nil RESTRICTED)
    ("ReplaceLine" (("Line" I4) ("String" STR)) NORMAL)


Wanders off, rubbing hands, laughing maniacally ...
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: Interogate an object for its ActiveX properties and methods ...
« Reply #53 on: November 13, 2007, 07:59:33 AM »
Michael,

.. Comments ?

Quote
... But it's actually probably easier to use OLEAUT32.DLL directly than it is to use TLBINF32.DLL.
Type Library Reader / Object Browser
updated 2007-10-07
http://www.jsware.net/jsware/vbcode.php3#tlbc

kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: Interogate an object for its ActiveX properties and methods ...
« Reply #54 on: November 13, 2007, 08:07:33 AM »
But it's actually probably easier to use OLEAUT32.DLL directly than it is to use TLBINF32.DLL.

I saw that Kerry (more than once) but it shares a worse fate than TLBINF32.DLL -- it's not on my pc even tho I've VB6 Enterprise installed. Figure that?

For all it's difficulty I've pretty much milked out everything I want from TLBINF32.DLL. I won't rule out OLEAUT32.DLL, but as I've many fish to fry and the TLBINF32.DLL is working (beyond my expectations really) OLEAUT32.DLL is a back burner route for now.

But genuine thanks for the heads up -- it's good to have scouts.

:)
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

SomeCallMeDave

  • Guest
Re: Interogate an object for its ActiveX properties and methods ...
« Reply #55 on: November 13, 2007, 08:18:15 AM »
This just in:

PROPERTIES

    (PROPERTY VALUE ACCESS VISIBILITY)

    ("CodePane" #<VLA-OBJECT _CodePane 077d6758> READONLY NORMAL)
    ("CountOfDeclarationLines" 1 READONLY NORMAL)
    ("CountOfLines" 7 READONLY NORMAL)
    ("Lines" "<Error: Invalid number of parameters>" READONLY NORMAL)
    ("Name" "ThisDrawing" READWRITE HIDDEN)
    ("Parent" #<VLA-OBJECT _VBComponent 071fb1bc> READONLY NORMAL)
    ("ProcBodyLine" "<Error: Invalid number of parameters>" READONLY NORMAL)
    ("ProcCountLines" "<Error: Invalid number of parameters>" READONLY NORMAL)
    ("ProcOfLine" "<Error: Invalid number of parameters>" READONLY NORMAL)
    ("ProcStartLine" "<Error: Invalid number of parameters>" READONLY NORMAL)
    ("VBE" #<VLA-OBJECT VBE 07361c84> READONLY NORMAL)
   
METHODS   

    (METHOD ARGUMENTS ACCESS)

    ("AddFromFile" (("FileName" STR)) NORMAL)
    ("AddFromString" (("String" STR)) NORMAL)
    ("AddRef" nil RESTRICTED)
    ("CreateEventProc" (("EventName" STR) ("ObjectName" STR)) NORMAL)
    ("DeleteLines" (("StartLine" I4) ("Count" I4 OPTIONAL)) NORMAL)
    ("Find" (("Target" STR) ("StartLine" I4) ("StartColumn" I4) ("EndLine" I4) ("EndColumn" I4) ("WholeWord" BOOL OPTIONAL) ("MatchCase" BOOL OPTIONAL) ("PatternSearch" BOOL OPTIONAL)) NORMAL)

    ("GetIDsOfNames" (("riid" EMPTY) ("rgszNames" I1) ("cNames" UINT) ("lcid" UI4) ("rgdispid" I4)) RESTRICTED)
    ("GetTypeInfo" (("itinfo" UINT) ("lcid" UI4) ("pptinfo" VOID)) RESTRICTED)
    ("GetTypeInfoCount" (("pctinfo" UINT)) RESTRICTED)
    ("InsertLines" (("Line" I4) ("String" STR)) NORMAL)
    ("Invoke" (("dispidMember" I4) ("riid" EMPTY) ("lcid" UI4) ("wFlags" UI2) ("pdispparams" EMPTY) ("pvarResult" variant) ("pexcepinfo" EMPTY) ("puArgErr" UINT)) RESTRICTED)
    ("QueryInterface" (("riid" EMPTY) ("ppvObj" VOID)) RESTRICTED)
    ("Release" nil RESTRICTED)
    ("ReplaceLine" (("Line" I4) ("String" STR)) NORMAL)


Wanders off, rubbing hands, laughing maniacally ...


Hmm.   A LISP routine that can write VBA code?   Verrrrry Interesting.
I can already see how this could replace some of my VBA add-ins already.


Great Work Michael.

daron

  • Guest
Re: Interogate an object for its ActiveX properties and methods ...
« Reply #56 on: November 13, 2007, 08:51:51 AM »
For anyone just joining this thread, the questions --

1. What version of Windows?
2. What version of AutoCAD?
3. Have you ever run the VBAIDE?
4. If found, what path on your machine hosts tlbinf32.dll?
5. Do you have Visual Studio 6 installed on an active drive?

:)

PS: Thanks to latest folks: CAB, Daniel and Steve.
tlitest
Better write a better _FindDLL MP!
1. XP Pro
2. 2006
3. Not on this machine
4. No.
5. No.
Ran vbaide and in acad typed tlitest with the same results.
Guess that answers that.

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: Interogate an object for its ActiveX properties and methods ...
« Reply #57 on: November 13, 2007, 03:18:31 PM »
There are many reasons why exploiting tlbinf32.dll is beneficial to me (and why I freaked when I first recognized I could abuse it from lisp). The following represents but one way I'll be using said ability.

In the past when interogating objects I used a combination of atoms-family harvesting and brute force interrogation, the latter which involved compiling and maintaining lists of property and method names for anything non vanilla, like AutoPlant structural etc.

Now it can be done fully dynamically.

Red highlighting was done quickly (read "might have missed one or two") to give you idea of the breadth of this:

====================================Object====================================

<IKs_ComShape 2130572120> (13/27 of <IAcadModelSpace 2130554104>)

==================================Properties==================================

Application              <IAcadApplication>
AreaClassName            
Color                    256
CrossSectionCatalog      CISC_W.DBF
CrossSectionName         W200X46
CutPlaneCount            0

Database                 <IAcadDatabase>
DetailCutCount           0
DisplayClassName
         
Document                 <IAcadDocument>
EntityName               Ks_Shape
EntityType               <Null Object, Reference or Value>
FacetCount               0
FamilyClassName
         
Handle                   133
HasExtensionDictionary   :vlax-false
HasTrueId                0
Height                   203.0
HoleFieldCount           0
Hyperlinks               <IAcadHyperlinks>
InsertOffsetX            0.0
InsertOffsetY            -101.5

InsertPoint              (0.0 12000.0 5000.0) <SafeArray>
IsReferenceManual        :vlax-false
IsWeldedIShape           :vlax-false
ItemNumber
               
Layer                    PS_SHAPE
Length                   5000.0
Linetype                 ByLayer
LinetypeScale            1.0
Lineweight               -1
LogicalLinkCount         0
Material                 165
Name                     W200x46
Note1                   
Note2
                   
ObjectID                 2130572120
ObjectName               Ks_Shape
OriginPosNumber         
OutletCount              0

OwnerID                  2130554104
PartOrigin               -1
PlotStyleName            ByLayer
PolyCutCount             0
PosNumber                1
ShipNumber               
SubbodyCount             0
TotalCount               8

TrueColor                <IAcadAcCmColor>
Visible                  :vlax-true
WeightCenter             (6.78547e-005 11898.5 2500.0) <SafeArray>
Width                    203.0
XAxis                    (-1.0 0.0 0.0) <SafeArray>
YAxis                    (0.0 1.0 0.0) <SafeArray>


===================================Methods====================================

AddRef                   nil RESTRICTED
AddReferenceLine         (("StartPoint" variant) ("EndPoint" variant)) NORMAL
AddSlopedEdgeAt          (("Point" variant)) NORMAL

ArrayPolar               (("NumberOfObjects" INT) ("AngleToFill" REAL) ("C ...
ArrayRectangular         (("NumberOfRows" INT) ("NumberOfColumns" INT) ("N ...
ClearReferenceOffset     nil NORMAL
ClearReferencePoints     nil NORMAL

Copy                     nil NORMAL
Delete                   nil NORMAL
DeleteSlopeFlangeSegment (("ThickIndex" INT)) NORMAL
DeleteSlopedEdgeAt       (("Point" variant)) NORMAL

Erase                    nil NORMAL
GetAnalysisIsChanged     (("Value" BOOL)) NORMAL
GetAnalysisIsConnected   (("Value" BOOL)) NORMAL
GetAnalysisIsProtected   (("Value" BOOL)) NORMAL
GetAnalysisLine          (("StartPoint" variant) ("EndPoint" variant)) NORMAL
GetAnalysisVectors       (("StartVector" variant) ("EndVector" variant))  ...
GetAreaClass             (("ClassIndex" INT)) NORMAL
GetBoundingBox           (("MinPoint" variant) ("MaxPoint" variant)) NORMAL
GetDirection             nil NORMAL
GetDisplayClass          (("ClassIndex" INT)) NORMAL
GetEndpointTo            (("ReferencePoint" variant)) NORMAL
GetEndsideTo             (("ReferencePoint" variant)) NORMAL

GetExtensionDictionary   nil NORMAL
GetFamilyClass           (("ClassIndex" INT)) NORMAL
GetIDsOfNames            (("riid" EMPTY) ("rgszNames" I1) ("cNames" UINT) ...
GetInsertUcs             (("vMatrix" variant)) NORMAL
GetLengthAddition        nil NORMAL
GetMidLine               (("MidLineStart" variant) ("MidLineEnd" variant)) ...
GetMidLineUcs            (("vMatrix" variant)) NORMAL
GetReferenceLine         (("StartPoint" variant) ("EndPoint" variant)) NOR...
GetReferenceOffset       (("Dx" REAL) ("Dy" REAL)) NORMAL
GetReferencePoints       (("Point1" variant) ("Point2" variant)) NORMAL
GetSlope                 nil NORMAL
GetSlopePolygons         (("WebPolygon" EMPTY) ("LowerPolygon" EMPTY) ("Up...
GetSlopedHeightAt        (("Point" variant) ("StartPoint" variant) ("EndPo...
GetTrueId                (("pVal" STR)) NORMAL

GetTypeInfo              (("itinfo" UINT) ("lcid" UI4) ("pptinfo" VOID)) RE...
GetTypeInfoCount         (("pctinfo" UINT)) RESTRICTED
GetVertexAtPoint         (("Point" variant) ("Topside" BOOL) ("Vertex" INT)...
GetWeight                nil NORMAL
GetWeightLine            (("WeightLineStart" variant) ("WeightLineEnd" vari...

GetXData                 (("AppName" STR) ("XDataType" variant) ("XDataValu...
GetXOrientation          nil NORMAL
GetYOrientation          nil NORMAL

Highlight                (("HighlightFlag" BOOL)) NORMAL
IntersectWith            (("IntersectObject" DISPATCH) ("option" EMPTY)) NO...
Invoke                   (("dispidMember" I4) ("riid" EMPTY) ("lcid" UI4) (...
Mirror                   (("Point1" variant) ("Point2" variant)) NORMAL
Mirror3D                 (("Point1" variant) ("Point2" variant) ("point3" v...
Move                     (("FromPoint" variant) ("ToPoint" variant)) NORMAL
QueryInterface           (("riid" EMPTY) ("ppvObj" VOID)) RESTRICTED
Release                  nil RESTRICTED
RetrieveGeometry         (("Geo" EMPTY)) NORMAL
Rotate                   (("BasePoint" variant) ("RotationAngle" REAL)) NORMAL
Rotate3D                 (("Point1" variant) ("Point2" variant) ("RotationA...
ScaleEntity              (("BasePoint" variant) ("ScaleFactor" REAL)) NORMAL
SetAnalysisIsChanged     (("Value" BOOL)) NORMAL
SetAnalysisIsConnected   (("Value" BOOL)) NORMAL
SetAnalysisIsProtected   (("Value" BOOL)) NORMAL
SetAnalysisLine          (("StartPoint" variant) ("EndPoint" variant)) NORMAL
SetAnalysisVectors       (("StartVector" variant) ("EndVector" variant)) NO...
SetAreaClass             (("ClassIndex" INT)) NORMAL
SetCrossSection          (("Name" STR) ("Catalog" STR)) NORMAL
SetDisplayClass          (("ClassIndex" INT)) NORMAL
SetFamilyClass           (("ClassIndex" INT)) NORMAL
SetLengthAddition        (("LengthAddition" REAL)) NORMAL
SetReferenceOffset       (("Dx" REAL) ("Dy" REAL)) NORMAL
SetShapeEnd              (("newShapeEnd" variant)) NORMAL
SetShapeMirror           nil NORMAL
SetShapeStart            (("newShapeStart" variant)) NORMAL
SetSlope                 (("Slope" REAL)) NORMAL
SetSlopeFlangeSegment    (("StartPoint" variant) ("EndPoint" variant) ("Wid...
SetSlopePolygons         (("LowerPolygon" EMPTY) ("UpperPolygon" EMPTY)) NO...
SetSlopedHeightAt        (("Position" variant) ("PickPoint" variant) ("Hei...
SetTrueId                (("newVal" STR)) NORMAL

SetXData                 (("XDataType" variant) ("XDataValue" variant)) NOR...
TransformBy              (("TransformationMatrix" variant)) NORMAL
Update                   nil NORMAL

===============================DXF Group Codes================================

-1    <Entity name: 7efdf358>
0     KS_SHAPE
330   <Entity name: 7efdacf8>
5     133
100   AcDbEntity
67    0
410   Model
8     PS_SHAPE


We use such property / method sheets to suppliment automation references for third party apps, which have traditionally been ummm, underweight and anemic. Having the ability to interrogate objects like this really helps when developing customization for non vanilla CADD apps.

la la la
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

JohnK

  • Administrator
  • Seagull
  • Posts: 10637
Re: Interogate an object for its ActiveX properties and methods ...
« Reply #58 on: November 13, 2007, 04:47:44 PM »
Sorry for my tardiness, i will read the post now.

Found CLSID: {8B21775E-717D-11CE-AB5B-D41203C10000}

1. What version of Windows?
        XP sp2
2. What version of AutoCAD?
        2008 MEP
3. Have you ever run the VBAIDE?
        Yes
4. What path on your machine hosts tlbinf32.dll?
        C:\WINDOWS\system32
5. Do you have Visual Studio 6 installed on an active drive?
        No
TheSwamp.org (serving the CAD community since 2003)
Member location map - Add yourself

Donate to TheSwamp.org

T.Willey

  • Needs a day job
  • Posts: 5251
Re: Interogate an object for its ActiveX properties and methods ...
« Reply #59 on: November 13, 2007, 05:04:30 PM »
But it's actually probably easier to use OLEAUT32.DLL directly than it is to use TLBINF32.DLL.

I saw that Kerry (more than once) but it shares a worse fate than TLBINF32.DLL -- it's not on my pc even tho I've VB6 Enterprise installed. Figure that?

That one is installed on my pc.  Just thought you might want to know that bit of info.  :-)
Tim

I don't want to ' end-up ', I want to ' become '. - Me

Please think about donating if this post helped you.