Calling a DLL using Javascript?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Venkat

    Calling a DLL using Javascript?

    Hi All,

    I know that this is not right forum to address this issue, i had posted
    this problem in Javascript forum but of no use, i appreciate if any
    one of you can answer or point me to some useful guide.
    I tried my hand in google and googlegroups(de janews) but of no benefit.

    I am not able to access a dll function from a remote script using
    ActiveXobject when
    an output parameter is used, but i could able to access the same when no
    output parameter
    is used.

    While calling a DLL function from my javascript app i am passing 3
    parameters
    (2 input parameters and 1 output parameter).
    The output parameter basically stores the return value which then will be
    used
    in my Javascript app.
    Pl note that in my IDL file i changed the return type of output parameter to
    [out, retval].

    Here is my Javascript file.

    fun1(id,passwor d)
    {
    var AutherizedUser;
    var ValidateObject = new ActiveXobject(" InstallDLL.Inst all");
    ValidateObject. ValidateUser(id ,password,Authe rizedUser);
    return AutherizedUser;
    }

    DLL

    STDMETHODIMP CInstall::Valid ateUser(BSTR userId, BSTR pwd, BOOL* pVal)
    {
    // TODO: Add your implementation code here
    LDAP *ldap;

    ldap = ldap_open("ldap .xyz.com", LDAP_PORT);

    if(ldap == NULL)
    {
    *pVal = FALSE;
    return S_FALSE;
    }

    ULONG val = ldap_simple_bin d_s(ldap, dn, BSTRToChar(pwd) );
    //pl note that these functions are working properly and no problem with
    them.
    if (val == LDAP_SUCCESS)
    {
    *pVal = TRUE;
    }
    else
    {
    *pVal = FALSE;
    return S_FALSE;
    }
    return S_OK;
    }

    I appreciate your help.


    Regards
    Venkat





Working...