rams
rams

Reputation: 69

how to call dlls from java script

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 = "";
    CnvUp(sel);
    document.all.CustFName.disabled = false;
    document.all.CustFName.focus();
}

Thanak in advance.

Upvotes: 0

Views: 550

Answers (1)

Uri London
Uri London

Reputation: 10797

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

Upvotes: 1

Related Questions