tags:

views:

25

answers:

2

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 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??

+2  A: 

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.

Richard Walters
+1  A: 

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")

Jeremy