Take the 2-minute tour ×

Can any one please help me how to call dll functions from javascript. while using activexobject I am getting error "automation server cannot create object". Here is my code

var jMyAcctId = document.all.RefNum.value;
var jMyAcctType = document.all.TrxType.value;
var NewObject = new ActiveXObject("HDMFCDV.cdv");
if (NewObject.IsValidID(jMyAcctId,jMyAcctType) == true)
    document.all.RefNumError.innerText = "";
    document.all.CustFName.disabled = false;

Thanak in advance.

share|improve this question
Please read the stackoverflow.com/faq about accepting answers to your questions. –  Alex W Jan 17 '13 at 7:10
@AlexW - Should have linked to this. –  Derek 朕會功夫 Jan 19 '13 at 21:29
add comment

1 Answer

Your JavaScript code is good. I suspect the problem is with the HDMFCDV.cdv ActiveX - either they way you implemented it or they way you registered it.

I'm not familiar with HDMFCDV object. Is that a proprietary object you implemented? Here are few tips to troubleshoot:

  1. Make sure your object is registered (did you run regsrv32?)
  2. Verify HDMFCDF.cdv is in the registry: HKCR\HDMFCDF.cdv
  3. Make sure there is a CLSID
  4. Make sure the class ID is in the registry, and that it points to the DLL implementing your object. HKCR\CLSID{your-guide}\InprocServer32 (REG_SZ)
  5. A very common lookout: have you implemented IObjectSafety. Without this interface, and without this interface returning that it is safe for untrusted caller, IE will refuse to instantiate this object
share|improve this answer
add comment

Your Answer


