Connecting Tech Pros Worldwide Forums | Help | Site Map

ActiveX by using javascript help

Newbie
 
Join Date: Feb 2007
Posts: 26
#1: Jul 31 '07
my first question is can i define a activex object using javascript so i won't need to use IIS
and my second question is how to do so if it is possible

gits's Avatar
Moderator
 
Join Date: May 2007
Location: Munich, Germany
Posts: 4,136
#2: Jul 31 '07

re: ActiveX by using javascript help


hi ...

what do you mean with 'define' ... clientside you may use ActiveX-Objects with jscript and IE only ...

kind regards
Newbie
 
Join Date: Feb 2007
Posts: 26
#3: Jul 31 '07

re: ActiveX by using javascript help


define like (in the javascript area)
var obj = new createobject(...) or like
var obj = new ActivexObject(...)
gits's Avatar
Moderator
 
Join Date: May 2007
Location: Munich, Germany
Posts: 4,136
#4: Jul 31 '07

re: ActiveX by using javascript help


Quote:

Originally Posted by shoram

define like (in the javascript area)
var obj = new createobject(...) or like
var obj = new ActivexObject(...)

yes ... you can ;) for example:

Expand|Select|Wrap|Line Numbers
  1. var xml_http_request_obj = new ActiveXObject('Microsoft.XMLHTTP');
  2.  
but as i said: it's IE-specific and not used by all other browsers ...

kind regards
Newbie
 
Join Date: Feb 2007
Posts: 26
#5: Jul 31 '07

re: ActiveX by using javascript help


thank you very much but if it wont be a problem can you tell me how to activate that object?
gits's Avatar
Moderator
 
Join Date: May 2007
Location: Munich, Germany
Posts: 4,136
#6: Jul 31 '07

re: ActiveX by using javascript help


hmmm ... the object has some methods you may call ... the shown one has open(), send() etc. ... and as far as i know you may find the documentation for the most common ActiveX-Objects at msdn. when using new ActiveXObject you create an instance of the 'class' and then you may use its methods, ask for the properties etc.

kind regards
Newbie
 
Join Date: Feb 2007
Posts: 26
#7: Aug 1 '07

re: ActiveX by using javascript help


it really helped , thanks
gits's Avatar
Moderator
 
Join Date: May 2007
Location: Munich, Germany
Posts: 4,136
#8: Aug 1 '07

re: ActiveX by using javascript help


no problem ;) ... post to the forum again when you have more questions ... anytime ...

kind regards
Newbie
 
Join Date: Feb 2007
Posts: 26
#9: Aug 1 '07

re: ActiveX by using javascript help


hey i want to start a control (in c# .net) using activex control
the problem is i need to start it using javascript so i dont know how to activate it

<script ...>

var myControl1 = new ActiveXObject(ActiveXDotNet.myControl);//the name of the class


//the problem is that i dont know what to do from here to send the wanted value into the activex from the html and how to activate that control that it will do what it needs to do with that value
</script>
Newbie
 
Join Date: Feb 2007
Posts: 26
#10: Aug 1 '07

re: ActiveX by using javascript help


and i have to not! use the IIS so i cant define the object in HTML
acoder's Avatar
Site Moderator
 
Join Date: Nov 2006
Location: UK
Posts: 14,581
#11: Aug 1 '07

re: ActiveX by using javascript help


Threads merged. Please keep all posts on one topic in the same thread.
acoder's Avatar
Site Moderator
 
Join Date: Nov 2006
Location: UK
Posts: 14,581
#12: Aug 1 '07

re: ActiveX by using javascript help


Quote:

Originally Posted by shoram

hey i want to start a control (in c# .net) using activex control
the problem is i need to start it using javascript so i dont know how to activate it

<script ...>

var myControl1 = new ActiveXObject(ActiveXDotNet.myControl);//the name of the class


//the problem is that i dont know what to do from here to send the wanted value into the activex from the html and how to activate that control that it will do what it needs to do with that value
</script>

Read up on the object in the documentation. Use the properties, attributes, methods, etc. of the class.

If you don't know how to access a particular element on the page, show your HTML code.

Also, perhaps you could explain exactly what you are trying to do. There may be a better way rather than using ActiveX.
Newbie
 
Join Date: Feb 2007
Posts: 26
#13: Aug 1 '07

re: ActiveX by using javascript help


no it must be activex and i unserstood all the rest but now my problem is a bit different
it says that my activex object is a null or dont exsist and i think its because script bolcker but i dont know how to handle them
Newbie
 
Join Date: Feb 2007
Posts: 26
#14: Aug 1 '07

re: ActiveX by using javascript help


skrech that my problem is now it says that the aotumation server can't create object and i made the initialize and script activex controls not marked as safe ... enabled
acoder's Avatar
Site Moderator
 
Join Date: Nov 2006
Location: UK
Posts: 14,581
#15: Aug 1 '07

re: ActiveX by using javascript help


Quote:

Originally Posted by shoram

skrech that my problem is now it says that the aotumation server can't create object and i made the initialize and script activex controls not marked as safe ... enabled

See if this Microsoft KB article helps. Also, see this thread.
Newbie
 
Join Date: Feb 2007
Posts: 26
#16: Aug 6 '07

re: ActiveX by using javascript help


how do i make an activex safe so it wont ask me if i want to use that activex because it might not be safe
acoder's Avatar
Site Moderator
 
Join Date: Nov 2006
Location: UK
Posts: 14,581
#17: Aug 6 '07

re: ActiveX by using javascript help


Quote:

Originally Posted by shoram

how do i make an activex safe so it wont ask me if i want to use that activex because it might not be safe

I've merged your threads - it's still the same problem.

Have you checked out the links? I think that you will need to sign your control (have it authenticated) to prevent the messages appearing.
Newbie
 
Join Date: Feb 2007
Posts: 26
#18: Aug 6 '07

re: ActiveX by using javascript help


i can create a object now because i registered the dll in the regasm and every thing is oky doky but now i need it without the annoying message when i activate that activex that says that the activex might be unsafe without changing the security levels in the internet option
somebody told me i needed to do a IObjectSafety interface but i cant find an easy example that is not in chinees.
if you can explain it to me or just send an exemple in c# that will be great
Reply