Author Topic: ActiveX Application Codes  (Read 6317 times)

0 Members and 1 Guest are viewing this topic.

Lee Mac

  • Seagull
  • Posts: 12914
  • London, England
ActiveX Application Codes
« on: February 15, 2010, 07:43:23 PM »
How can one work out what is meant to go here:

Code: [Select]
(vlax-create-object "[color=red]...[/color]")

for certain applications?

Lee

ronjonp

  • Needs a day job
  • Posts: 7529
Re: ActiveX Application Codes
« Reply #1 on: February 15, 2010, 11:37:46 PM »
Probably not the best way but I went rooting through the HKEY_CLASSES_ROOT\ in the registry at one time to get to some objects created by our in-house software.  :-D

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

jbuzbee

  • Swamp Rat
  • Posts: 851
Re: ActiveX Application Codes
« Reply #2 on: February 16, 2010, 08:06:03 AM »
Lee,  it's tedious but try here:

http://msdn.microsoft.com/en-us/default.aspx
James Buzbee
Windows 8

LE3

  • Guest
Re: ActiveX Application Codes
« Reply #3 on: February 16, 2010, 10:18:34 AM »
How can one work out what is meant to go here:

Code: [Select]
(vlax-create-object "[color=red]...[/color]")

for certain applications?

Lee

Do you mean by codes to access the methods and the properties?.

That it is a way to access a COM server.

Lee Mac

  • Seagull
  • Posts: 12914
  • London, England
Re: ActiveX Application Codes
« Reply #4 on: February 16, 2010, 11:21:15 AM »
Thanks Guys,

I have had a look at the MSDN site - (nothing seems to be too organised on there...  :| )

Luis >

I mean the codes such as 'Excel.Application' for Excel, for example.

Lee

LE3

  • Guest
Re: ActiveX Application Codes
« Reply #5 on: February 16, 2010, 11:37:45 AM »
Thanks Guys,

I have had a look at the MSDN site - (nothing seems to be too organised on there...  :| )

Luis >

I mean the codes such as 'Excel.Application' for Excel, for example.

Lee

Sample code, then?
If that's the case, there are a lot (I think) samples on how to access that server, I might still have something about of excel in particular (a program that I personally never had/needed to use it)... will check.

Lee Mac

  • Seagull
  • Posts: 12914
  • London, England
Re: ActiveX Application Codes
« Reply #6 on: February 16, 2010, 11:41:29 AM »
Thanks Guys,

I have had a look at the MSDN site - (nothing seems to be too organised on there...  :| )

Luis >

I mean the codes such as 'Excel.Application' for Excel, for example.

Lee

Sample code, then?
If that's the case, there are a lot (I think) samples on how to access that server, I might still have something about of excel in particular (a program that I personally never had/needed to use it)... will check.

That's Ok, I have worked with Excel many times.

But, for example, I saw this thread:

http://www.theswamp.org/index.php?topic=19380.msg237054#msg237054


Involving accessing MSN with ActiveX - and just wondered how Patrick knew the code to use.

(not that I want to access MSN, just curious how he came about the knowledge).

LE3

  • Guest
Re: ActiveX Application Codes
« Reply #7 on: February 16, 2010, 11:50:23 AM »
You are talking about the PROG-ID 's

LE3

  • Guest
Re: ActiveX Application Codes
« Reply #8 on: February 16, 2010, 12:05:21 PM »
You are talking about the PROG-ID 's

I think that was answered on the second post.

Don't have some function in particular that you could use, but maybe a way to scan the registry and look for all the ProgID keys, and or start on the CLSID sections

LE3

  • Guest
Re: ActiveX Application Codes
« Reply #9 on: February 16, 2010, 12:10:34 PM »
Have a look here Lee,

http://www.devx.com/vb2themax/Tip/18726

Won't be to hard to convert that into lisp.

gskelly

  • Newt
  • Posts: 185
Re: ActiveX Application Codes
« Reply #10 on: February 16, 2010, 12:51:44 PM »

Not sure if I am off base but you can explore around with SharpDevelop in the Component Inspector. Look at the ActiveX/COM tab and open the list of ProgIds from the Registry. Right click and you can create an application object and switch to the Objects tab.

You can also explore with the COM typelibs in the Object Browser in MS Visual Studio 2008 (Express has it too).

Bricscad v12

Atook

  • Swamp Rat
  • Posts: 1029
  • AKA Tim
Re: ActiveX Application Codes
« Reply #11 on: February 16, 2010, 01:03:12 PM »
If the library your looking for is registered, you should be able to see it in the object browser in the VBA IDE.

Open CAD. Hit Alt+F11 to bring up the VBA IDE.

Go to Tools-> References. Check the library you’re looking for.  Click OK

Hit F2 to bring up the object browser, you’ll see the library objects for whatever library you’re interested in.

Lee Mac

  • Seagull
  • Posts: 12914
  • London, England
Re: ActiveX Application Codes
« Reply #12 on: February 16, 2010, 03:50:40 PM »
Thanks guys! - I'll have a play and see what I can find  :wink:

Lee Mac

  • Seagull
  • Posts: 12914
  • London, England
Re: ActiveX Application Codes
« Reply #13 on: February 17, 2010, 06:38:31 AM »
Thanks for that link Luis,

I was able to construct this in LISP:

Code: [Select]
(defun GetProgIDs (/ *error* regPath file id ofile lst)
  (vl-load-com)
  ;; Lee Mac  ~  17.02.10

  (defun *error* (msg)
    (and ofile (close ofile))
    (or (wcmatch (strcase msg) "*BREAK,*CANCEL*,*EXIT*")
        (princ (strcat "\n** Error: " msg " **")))
    (princ))    

  (if (setq file (getfiled "Output" "" "txt" 1))
    (progn
  
      (foreach desc (vl-registry-descendents
                      (setq regPath "HKEY_CLASSES_ROOT\\CLSID"))

        (if (setq id (vl-registry-read
                       (strcat regPath "\\" desc "\\ProgId")))
          
          (setq lst (cons (vl-princ-to-string id) lst))))

      (setq ofile (open file "w"))
      (mapcar
        (function
          (lambda (x) (write-line x ofile))) (acad_strlsort lst))

      (setq ofile (close ofile))))
  
  (princ))

Any idea as to why it is such a CPU intensive process?   :|

EDIT:- I'm guessing its CPU its intensive because I am printing them all to the console - writing them to a file is pretty quick considering there are 3013 of them...

EDIT EDIT:- Code updated to write them to a file.
« Last Edit: February 17, 2010, 08:44:40 AM by Lee Mac »

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: ActiveX Application Codes
« Reply #14 on: February 17, 2010, 08:32:46 AM »
What happens to the speed if you print them separately.
I found that doing nothing but reading the file is the fastest way to access the file.
Faster than interrupting the flow of information.

Add this after the files are closed.
(mapcar 'vl-princ-to-string lst)

Don't 3000+ exceed the command line capacity to scroll back?
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.