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

0 Members and 1 Guest are viewing this topic.

MP

  • Seagull
  • Posts: 17446
Interogate an object for its ActiveX properties and methods ...
« on: November 10, 2007, 12:38:55 AM »
... a work in progress.

And I need your help to do it.

Based on this thread I've a bunch of LISP code written to achieve the title's namesake and it's working quite nicely, but it's all for naught if the average machine doesn't have the type library info dll installed and registered, so I need you to run a quick test. Although my reading suggests tlbinf32.dll should be on any PC that's had VB or VBA installed (it's what used to populate the object browser [F2]) I hate assuming.

Can you run the code snip that follows and tell me what it prints to the screen?

Code: [Select]
(defun c:TliTest ( / _GetTliCLSID _FindDLL _RegSvr32 _Main )

    (defun _GetTliCLSID ( )
        (vl-registry-read
            (strcat
                "HKEY_CLASSES_ROOT\\"
                "TLI.TLIApplication\\"
                "CLSID"
            )                 
        )
    )   
   
    (defun _FindDLL ( dll / path windir )
   
        (if
            (vl-some
               '(lambda (x) (setq path (findfile x)))
                (list
                    dll
                    (strcat
                        (setq windir (getenv "WinDir"))
                        "\\System\\"
                        dll
                    )
                    (strcat windir "\\System32\\" dll)
                )
            )
            path
        )   
   
    )   
   
    (defun _RegSvr32 ( dll / cmd path match )
   
        (vl-some
           '(lambda (x) (startapp x (strcat "\"" dll "\" /s")))
            (list
                (setq cmd "regsvr32.exe")
                (strcat
                    (setq path (getenv "WinDir"))
                    "\\System\\"
                    cmd
                )
                (strcat path "\\System32\\" cmd)
            )
        )
   
    )
   
    (defun _Main ( / clsid dllpath )
   
        (if (setq clsid (_GetTliCLSID))
            (princ (strcat "Found CLSID: " clsid))
            (if (setq dllpath (_FindDll "tlbinf32.dll"))
                (progn
                    (princ (strcat "Found DLL: " dllpath))
                    (_RegSvr32 dllpath)   
                    (if (setq clsid (_GetTliCLSID))
                        (princ (strcat "Found CLSID: " clsid))
                        (princ "Doh! DLL registration failed.")
                    )
                )
                (princ "Better write a better _FindDLL MP!")
            )
        )
       
        (princ)
   
    )
   
    (_Main)

)

Also, if you could answer these riveting questions --

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

ABUNDANT THANKS FOR YOUR HELP.

:)
« Last Edit: November 10, 2007, 11:22:08 AM by MP »
\|// Set goal. Experiment tirelessly until
|Oo| practice has become expertise.  Loop.
|- | LinkedIn | Dropbox

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: Interogate an object for its ActiveX properties and methods ...
« Reply #1 on: November 10, 2007, 01:29:45 AM »
Found CLSID: {8B21775E-717D-11CE-AB5B-D41203C10000}

added :

FileVersion: 1.1.97.82
buildDate: February 23, 2004
« Last Edit: November 10, 2007, 02:07:27 AM by Kerry Brown »
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

--> Donate to theSwamp<--

VovKa

  • Swamp Rat
  • Posts: 1153
  • Ukraine
Re: Interogate an object for its ActiveX properties and methods ...
« Reply #2 on: November 10, 2007, 04:35:05 AM »
mine prints nothing. i do have the file you are talking about

MP

  • Seagull
  • Posts: 17446
Re: Interogate an object for its ActiveX properties and methods ...
« Reply #3 on: November 10, 2007, 07:40:51 AM »
Found CLSID: {8B21775E-717D-11CE-AB5B-D41203C10000}

added :

FileVersion: 1.1.97.82
buildDate: February 23, 2004

Thanks Kerry, greatly appreciated. Mine's the same version but a day earlier (22). ??

mine prints nothing. i do have the file you are talking about

Thanks for trying VovKa. Couple questions --

1. What version of Windows?
2. What version of AutoCAD?
3. Have you ever run the VBAIDE?
4. What path on your machine hosts tlbinf32.dll?

Thanks folks, appreciate your participation.

:)

Note to self: Write a more robust version of FindDLL.
\|// Set goal. Experiment tirelessly until
|Oo| practice has become expertise.  Loop.
|- | LinkedIn | Dropbox

Chuck Gabriel

  • Guest
Re: Interogate an object for its ActiveX properties and methods ...
« Reply #4 on: November 10, 2007, 07:46:58 AM »
Found CLSID: {8B21775E-717D-11CE-AB5B-D41203C10000}

mkweaver

  • Bull Frog
  • Posts: 344
Re: Interogate an object for its ActiveX properties and methods ...
« Reply #5 on: November 10, 2007, 08:12:57 AM »
... a work in progress.

And I need your help to do it.

Based on this thread I've a bunch of LISP code written to achieve the title's namesake and it's working quite nicely, but it's all for naught if the average machine doesn't have the type library info dll installed and registered, so I need you to run a quick test. Although my reading suggests tlbinf32.dll should be on any PC that's had VB or VBA installed (it's what used to populate the object browser [F2]) I hate assuming.

Can you run the code snip that follows and tell me what it prints to the screen?


Quote
_$ (c:tlitest)
Better write a better _FindDLL MP!
And this with Visual Studio 2005 Pro installed and running with the object browser open.  I also run VBA regularly.

When I first found the tlbinf32.dll information, I wondered if I could count on it being installed on other machines - I appreciate your research.

MP

  • Seagull
  • Posts: 17446
Re: Interogate an object for its ActiveX properties and methods ...
« Reply #6 on: November 10, 2007, 08:26:29 AM »
And this with Visual Studio 2005 Pro installed and running with the object browser open.  I also run VBA regularly.

That's weird. Couple questions Mike --

1. What version of Windows?
2. What version of AutoCAD?
3. Have you ever run the VBAIDE?
4. What path on your machine hosts tlbinf32.dll?

When I first found the tlbinf32.dll information, I wondered if I could count on it being installed on other machines - I appreciate your research.

My pleasure sir, isn't great we have a place like the swamp to collaborate? Three cheers to Mark Thomas, woot!

Thanks for pitching in Mike.

:)
\|// Set goal. Experiment tirelessly until
|Oo| practice has become expertise.  Loop.
|- | LinkedIn | Dropbox

VovKa

  • Swamp Rat
  • Posts: 1153
  • Ukraine
Re: Interogate an object for its ActiveX properties and methods ...
« Reply #7 on: November 10, 2007, 08:39:31 AM »
Quote
Thanks for trying VovKa. Couple questions --
1. What version of Windows?
2. What version of AutoCAD?
3. Have you ever run the VBAIDE?
4. What path on your machine hosts tlbinf32.dll?
first of all, sorry MP, a missed a very important word in my first post, the word "not" :)
should be: "i do NOT have the file you are talking about"
if this still matters, i use w2k sp4, Autocad 2004 with Map enabled, and i've run VBAIDE and it's OK

SomeCallMeDave

  • Guest
Re: Interogate an object for its ActiveX properties and methods ...
« Reply #8 on: November 10, 2007, 09:07:05 AM »
Found CLSID: {8B21775E-717D-11CE-AB5B-D41203C10000}


CAB

  • Global Moderator
  • Seagull
  • Posts: 10365
Re: Interogate an object for its ActiveX properties and methods ...
« Reply #9 on: November 10, 2007, 09:20:32 AM »
Good morning Michael.

File not found!

1. What version of Windows?  2000 SP4
2. What version of AutoCAD?  2K 2K4 2K6
3. Have you ever run the VBAIDE?  Yes- in all versions, but only to open
4. What path on your machine hosts tlbinf32.dll? None

FYI I have Visual Basic Installed on my D Drive which is disconnected at this time.
If that matters at all.
I've reached the age where the happy hour is a nap. ()
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

Sdoman

  • Guest
Re: Interogate an object for its ActiveX properties and methods ...
« Reply #10 on: November 10, 2007, 09:32:30 AM »
Hi MP,

Here are my results from running c:tlitest:

Code: [Select]
Command: TLITEST
Better write a better _FindDLL MP!
Command:

My PC:
Windows XP
AutoCAD 2007 SP1
Windows search did not find file tlbinf32.dll

HTH
Steve


MP

  • Seagull
  • Posts: 17446
Re: Interogate an object for its ActiveX properties and methods ...
« Reply #11 on: November 10, 2007, 11:06:30 AM »
Hmmm ....

Group A (yeah)
MP
Kerry
Chuck
Dave
Daniel

Group B (nay)
VovKa
Mike Weaver
CAB
Steve

I'm going to take a wild stab here and guess that Group A has Visual Studio 6 (or Visual BASIC 6) installed on an active drive and that Group B does not.

Can you folks confirm?

Also, if I can confirm tlbinf32.dll is a fully distributable file by Microsoft would you folks that don't have it be ok with a program creating it and registering it? Or would you prefer a link to it so you can install it and register it? I'm leaning towards the latter myself.

Thanks for your participation folks.

:)

Edit: Added Daniel, and it looks like the Visual Studio 6 guess thing might be a reasonable guess.
« Last Edit: November 10, 2007, 11:19:44 AM by MP »
\|// Set goal. Experiment tirelessly until
|Oo| practice has become expertise.  Loop.
|- | LinkedIn | Dropbox

It's Alive!

  • BricsCAD
  • Needs a day job
  • Posts: 6942
  • AKA Daniel
Re: Interogate an object for its ActiveX properties and methods ...
« Reply #12 on: November 10, 2007, 11:11:33 AM »
Found CLSID: {8B21775E-717D-11CE-AB5B-D41203C10000}
Windows XP, AC08, VS (6) – 2008, Never touched VBA
Found tlbinf32.dll in system folder

Edit: for installing;  install the complete package.   
« Last Edit: November 10, 2007, 11:27:29 AM by Daniel »

MP

  • Seagull
  • Posts: 17446
Re: Interogate an object for its ActiveX properties and methods ...
« Reply #13 on: November 10, 2007, 11:23:52 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.
\|// Set goal. Experiment tirelessly until
|Oo| practice has become expertise.  Loop.
|- | LinkedIn | Dropbox

mkweaver

  • Bull Frog
  • Posts: 344
Re: Interogate an object for its ActiveX properties and methods ...
« Reply #14 on: November 10, 2007, 11:48:35 AM »
For anyone just joining this thread, the questions --

1. What version of Windows?XP Pro, Service Pack 2
2. What version of AutoCAD?2006, vanilla, Service Pack 1
3. Have you ever run the VBAIDE?Yes
4. If found, what path on your machine hosts tlbinf32.dll?Not found
5. Do you have Visual Studio 6 installed on an active drive?No.  but I have Visual Studio 2005 (version 8.0.5)

:)

PS: Thanks to latest folks: CAB, Daniel and Steve.