|
-
Apr 5th, 2006, 03:06 PM
#1
Thread Starter
Member
Javascript instantiate COM object?
Hi everyone,
I have a IE web site that needs to use a series of DLL files
loaded on the client machine.
I know that an activeX can call the objects,
but we are talking about having javascript instantiate and use the
functions in the DLL.
This might be in the wrong forum - sorry if it is.
thanks
tony
-
Apr 6th, 2006, 09:34 AM
#2
Re: Javascript instantiate COM object?
Can JavaScript use the CreateObject command?
Nobody knows what software they want until after you've delivered what they originally asked for.
Don't solve problems which don't exist.
"If I had eight hours to cut down a tree, I'd spend six hours sharpening my axe." --- Abraham Lincoln (1809-1865)
2 idiots don't make a genius.
-
Apr 7th, 2006, 09:22 AM
#3
Thread Starter
Member
Re: Javascript instantiate COM object?
if i knew the answer, then i guess i wouldn't have needed to post the questions -
god i hate people that answer a friggin question with another question
GFO
-
Apr 7th, 2006, 09:26 AM
#4
Re: Javascript instantiate COM object?
Nobody knows what software they want until after you've delivered what they originally asked for.
Don't solve problems which don't exist.
"If I had eight hours to cut down a tree, I'd spend six hours sharpening my axe." --- Abraham Lincoln (1809-1865)
2 idiots don't make a genius.
-
Apr 7th, 2006, 09:48 AM
#5
Re: Javascript instantiate COM object?
 Originally Posted by pithhelmet
if i knew the answer, then i guess i wouldn't have needed to post the questions -
god i hate people that answer a friggin question with another question
GFO
You'll get absolutely nowhere with an attitude like that. We're trying to help you, so cool it.
-
Apr 7th, 2006, 12:33 PM
#6
Thread Starter
Member
Re: Javascript instantiate COM object?
you are correct - i need to cool it
GFO
and
GFY
-
Apr 21st, 2006, 06:05 PM
#7
New Member
Re: Javascript instantiate COM object?
yes, you can, provided the object exists on the server if running from a webpage (unless it's a .HTA application, in which object on client is ok?).
Here's a syntax example:
myObj = new ActiveXObject("Word.Application");
then use it the same way as with VBScript. But remember methods must be called with () like myObj.myMethod(args); and don't forget the semicolon at the end.
You can also perform error/exception handling of the COM object by using a try/catch block in javascript on the object method in question, etc. like
try{
myObj.mymethod();
}catch(err){
//handle error here
}
I find this kind of COM error handling much more effective than when using VBScript to do the equivalent (which lacks the extra error handling features of VB).
Last edited by daluu; Apr 21st, 2006 at 06:11 PM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|