Solved

New ActiveX object creation question

Posted on 2004-08-19
3
3,844 Views
Last Modified: 2008-01-09
Hi
I tried creating an instance of an object using the following
var myobj = New ActiveXObject("MyDll.thisobject") and it failed
Tried this
var myobj = New ActiveXObject("clsID:3e456789jfjh822334") and it failed

Tried this
<object classID="clsID:3e456789jfjh822334" id=myobj></object>
and it worked so I could refer to this in my Javascript like myobj.myproperty=10

Why does the first way of instancing the object fail and why did the second work?  BTW The first method of instancing worked on a different laptop.

I thought that the object tag is to embed visual controls into HTML and then manipulate but the preferred way of instancing a non visual COM object was using the New syntax.

Please explain....




0
Comment
Question by:geoenvi
  • 2
3 Comments
 
LVL 63

Accepted Solution

by:
Zvonko earned 500 total points
ID: 11844119
Because you used New instead of new.
0
 

Author Comment

by:geoenvi
ID: 11844396
Someone please Kick me...
0
 
LVL 63

Expert Comment

by:Zvonko
ID: 11844531
If the life would be always such easy ;-)
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Today I would like to talk about localizing (Internationalization) JavaScript applications. Introduction When creating an application that is going to be used by many people around the globe, it is important to remember that not everyone speak…
The task A number given should be formatted for easy reading by separating digits into triads. Format must be made inline via JavaScript, i.e., frameworks / functions are not welcome. So let’s take a number like this “12345678.91¿ and format i…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

932 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now