473,383 Members | 1,821 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

Calling a dll from a Javascript

Hi All,

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,password)
{
var AutherizedUser;
var ValidateObject = new ActiveXobject("InstallDLL.Install");
ValidateObject.ValidateUser(id,password,Autherized User);
return AutherizedUser;
}

DLL

STDMETHODIMP CInstall::ValidateUser(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_bind_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

Jul 20 '05 #1
1 8329
"Steve van Dongen" <st*****@hotmail.com> wrote in message
news:1u********************************@4ax.com...
On Thu, 28 Aug 2003 17:05:06 -0500, "Venkat" <ve*******@yahoo.com>
wrote:
Hi All,

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.

<snip />

Unfortunately, JScript doesn't support out parameters. If you're
working in an environment where its possible to use VBScript, you
could write a wrapper function in VBScript that you could call from
JScript.

Regards,
Steve


I found the problem and i don't avoid anyone any point.
The calling of DLL function is different when output parameters are used.

If id,password and AutherizedUser are Input parameters then Javascript
calling is

var AutherizedUser;
var ValidateObject = new ActiveXobject("InstallDLL.Install");
ValidateObject.ValidateUser(id,password,Autherized User);
return AutherizedUser;

If id and password are input parameters and AuthorizedUser is output
parameter then the calling is
var AutherizedUser;
var ValidateObject = new ActiveXobject("InstallDLL.Install");
AutherizedUser = ValidateObject.ValidateUser(id,password);
return AutherizedUser;
Thought it will be helpful to others.

Regards
Venkat
Jul 20 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Julia Briggs | last post by:
Hello World - I admit I'm new to javascript but I've tried for days to find a solution to my problem. Basically I have 3 unique javascript files that do different screen display events that I...
18
by: Simula | last post by:
I am developing an HTML javascript application and I want to preserve state in a way that can be book-marked. I chose HTML anchors as a means of preserving state. When the application changes...
5
by: Krishna | last post by:
Hi all, Can i call my javascript functions from the web controls.Any appropriate site which will be tell more on this will be helpfull. Regards.., Krishna
1
by: desmcc | last post by:
Hi, I am launching a modal dialog through the usual javascript (window.showmodaldialog). When the modal dialog is complete (ie user selects OK), the calling page then refreshes itself by setting...
4
by: Martin Feuersteiner | last post by:
Dear Group I'm using VB to write an aspnet application. I would like to call a javascript function from within a VB Sub or VB Function, is it possible? My code is something like this: VB...
13
by: ukrbend | last post by:
I'm new to Javascript and to html and am trying to make the following code snippet work but it doesn't. It refuses to call the getPage() function and I always get a 404 error. I know the code is...
3
by: Opa | last post by:
Hi , I have a form with javasript which launches a popup via the showModalDialog() method. I get the dialog to open, now I am trying to first get a reference to the calling form from the popup...
4
by: Adam Smith | last post by:
Hello, How can I call or trigger an external javascript twice in a form? I have <script language="JavaScript" src="country_state.js" name="Country_State"> <script type="text/javascript"...
5
by: Newbie Coder | last post by:
Hello all I have 3 functions in a javacrip file (MyScript.js), which is added to an ASP.NET 2.0 project 1) no right-click 2) no select text (copy...) 3) History.Back()' How do I call...
6
by: Ajit Goel | last post by:
Hi; We have a Javascript function which I have been tasked to move to a CSharp class. This javascript function uses Regular expression extensively. This function has a string input parameter and...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.