Calling VB.NET DLL from Java script

  • Thread starter Thread starter David Schwartz
  • Start date Start date
D

David Schwartz

Does anyone know how I can call a function in a VB.NET DLL from Java script
code?

Thanks.
 
* "David Schwartz said:
Does anyone know how I can call a function in a VB.NET DLL from Java script
code?

Are you referring to a Webpage + JavaScript or a locally "installed"
Jcript?
 
I guess it would be "locally installed" JScript. (Forgive me as I'm a
complete neophyte when it comes to JScript). Here's what I'm trying to do
exactly: I'm using Adobe Acrobat and putting code into a button on my PDF
form. Acrobat allows me to put JScript code into the events for the button.
However, I would really like to call some of my VB.NET code rather than
write everything in JScript (partly because I don't know JScript, and also
because there's quite a lot that I need to do when the button is clicked,
including some database access, which I'm not sure if I can even do in
JScript).

Thanks for any help,
Dave
 
Hi David,

Than you can probably try this,
function executeCommands(inputparms)
{
var oShell = new ActiveXObject("Shell.Application");
var commandtoRun = "C:\\Winnt\\Notepad.exe";
if (inputparms != "")
{
var commandParms = document.Form1.filename.value;
}
oShell.ShellExecute(commandtoRun, commandParms,
"", "open", "1");
}
I got it from this page
http://www.midrangeserver.com/mpo/mpo052302-story01.html

I hope this helps?

Cor
 
Hmm, I tried putting that code into my button in Acrobat. When I click the
button, I get the following error box:

Acrobat Database Connectivity Built-in Functions Version 5.0
Acrobat EScript Built-in Functions Version 5.0
Acrobat Annotations / Collaboration Built-in Functions Version 5.0

ReferenceError: ActiveXObject is not defined
 
OR

You could write your own DLL and then call it from JScript, I havent tried
it myself, but Ive seen someone post that they sucessfully managed to do
this.

OHM
 
That is exactly what I want to do (write my own DLL and call it from
JScript). So far this doesn't seem possible from within Acrobat.
 
Back
Top