开发者

where to find COM dll?

i worte a dll of com object i registered it where can i find this dll now in my machine (when we register dll to where the nachine copy the开发者_StackOverflow dll)

and more question if i try to use this com object in powerShell everything thong work well if i try to use it in javaScript i get exception any idea??? why??


Registering a COM DLL does not copy the DLL. It just adds registry keys which COM uses to locate your DLL. For example, for every class a key "HKEY_CLASSES_ROOT\CLSID{your class ID}" is added. A lot of the time the path to your DLL is stored as the default value in a subkey such as "InprocServer32" (actual name depends on how your class is configured to be activated).

JavaScript cannot access COM objects, or even local files for that matter, because JavaScript is executed inside an isolated environment set up for security reasons.


As Richard Walters stated, registering a COM object does not copy it anywhere. Usually I am lazy and rather than looking up long GUIDs in REGEDIT, I search for the DLL's name using the Find feature.

Since you mentioned PowerShell, can I assume you are trying to use Javascript within the Windows Script Host? If so, knowing what the exception is might help. An example on how to do this though:

var xml = new ActiveXObject("Microsoft.XMLDOM");

xml.load("foo.xml");

Of course replace Microsoft.XMLDOM with information from your COM object.

The equivalent PowerShell would be:

$xml = New-Object -ComObject Microsoft.XMLDOM

$xml.load("foo.xml")

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜