use CreateObject to access to COM,so to obtain some functions that are not provided in VBscript or Jscript

if COM Objects start with the same name, they are in the same physical file.All the Scripting Objects live inside SCRRUN.DLL, and all the WScript Objects
are stored inside WSHOM.OCX. You can view both files in the Windows system
folder.

Any object name you supply to CreateObject—like Scripting.
FileSystemObject or WScript.Shell—is really a ProgID, or program
identifier. You will always find a Registry key in HKEY_CLASSES_ROOT\ with
the same name. This is the central store telling CreateObject how to
access the object. If the Registry key is missing, you will no longer be able
to access the object.

It has two subkey:CLSID and CurVer. CLSID shows the classID.The compiler that produced the run-time object generates the Class-ID.you can’t manually
change the Class-ID by changing Registry values. If you did, you could no
longer access the object because the Registry Class-ID needs to match the
Class-ID stored inside the object. The same is true if you update an object file.
Because the new version has a new Class-ID, you need to register the new
object. Just replacing the file would disable the object.

go to HKEY_CLASSES_ROOT\CLSID\ to find detailed object information


评论

该日志第一篇评论

发表评论

评论也有版权!