Accessing COM object written in C# using JavaScript

Hello. I have an COM object that was written in C# using Visual Studio 2005. This is a COM object. I was able to instantiate this COM object using C++
code. (I had to import the tlb file at the top of the C++ file.)

Now I need to write JavaScript to access this COM object. The code I am using is this:
try
{
var myCOMObject = new ActiveXObject("progid");
}
catch (err)
{
}

where progid is the progid from the registry. (It's under KEY_CLASSES_ROOT\CLSID\(guid)\ProgID.

This is going into the catch block. The error it is getting (err.number) is -2146827859. I searched the Web, and this error code means "Automation server can't create object."

What am I doing wrong? I need to create this COM object in JavaScript.

- I did register the assembly using regasm.
- I know the COM object is defined because I can see it in the registry and I was able to access the COM object using C++. (I just can't access it in JavaScript.)

Many thanks in advance for the help.

0
JustinInGwinnett
2/5/2008 9:46:39 PM
asp.net.getting-started 91979 articles. 4 followers. Follow

1 Replies
552 Views

Similar Articles

[PageSpeed] 14

 Does your COM object implement IDispatch? Javascript and other scripts interact with COM objects using IDispatch.


Regards,
Prashant


Dont forget to click "Mark as Answer" on the post that helped you.
0
Prashant
2/6/2008 8:34:53 AM
Reply:

Similar Artilces:

Accessing a Com object using Get Object
* Wasn't sure which section to put this in, but found similiar topics in here. We have a slight problem trying to access a COM Object. Reading some of the threads in this forum, people have mentioned trying to connect to a COM Object, but everyone has suggested using CreateObj. We cannot do this as the object is already created, we need to Get this object. Obviously you can use the GetObj command in VB6, but we cannot find away of Getting this object either through a webservice. Feel free to move this to the correct forum. Any help will be greatly recieved. Regards C ...

Sending SMS using vb.net or C#.net using vb.net or c#.net
Hi  My requirement is I hav one csv file with these fields id,mobilenum,messgae,status.intiallu staus is 0. once i read the all fileds and take that mobile number.using tat mobile number  i need to send sms .after sending sms i shuld change status as 1 How to send sms thru coding (please dont provide any links.if it is provide also please give working links becox i checked codeproject .i didnt get any nice link. and also provide the how to update the status field im csv file   Thank ssandhya   To send SMS, you need some third party SMS providers. if you consul...

C++ access violation when using JavaScript objects
Being completely new to Firefox extensions/plugins, XPConnect, and SpiderMonkey, I'm clearly missing a critical step and was hoping someone here could point me in the right direction. We have some existing C++ code we want to incorporate into a Firefox plugin so that Web pages can interact with our C++ using JavaScript embedded in the Web page. We're not trying to embed SpiderMonkey into our plugin...rather we need to use the native instance running in Firefox. The following link is very helpful in that it acknowledges this can occur and gives me the IDL I need to begin cr...

getting access to VSTS server using .net,c#
Hi all, is their any possible method in which i can read visual studio team system "VSTS" server, and get to know the list of all the files checkout in the server using asp.net,c#. my main requirement is i have a "VSTS" server and a login user, i need to get the list of all the files thats checkout by the particular user and generate a report using asp.net c#, pls let me know any clue on this, its very urgent thanks in advanceRamesh SDELL,Bangalore, Koramangala,IndiaPlease remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does ...

How to use a COM object written in C++ within PB
I need some help on how to use a COM object written in C++ saved as a xxx.DLL within PowerBuilder 6.5. We don't want to have to "deploy" this COM object to an application server, and have to create a "proxy" object to call it. we want to simply use this COM object from the file system where it resides, basically like an external function within a normal DLL. Thanks Chris Read about the ConnectToNewObject and GetAutomationNativePointer PowerScript methods in the online help. -- <hopethishelps /> Roy Kiesler [TeamSybase] mySybase -- htt...

How to get local app.config path for a .NET COM object used in aspx page
Hi all, We have an application with two parts: - An ASP.NET 2.0 web site - A VB.NET 2.0 class library (dll) which is compiled to be a COM component, so the public classes have a COM classid for each one. Most of the operations in the web site are run in the server (in the normal asp.net way), but a few operations have to be run locally in the client PCs which are running the web browser. To allow this, we use COM: we place <object> elements in the aspx pages, with the classids of the right library class. We install some files in the client PCs, including a local app.config...

use VB.NET and C#.NET code in the same C#.NET project
All-- Here is a sample that is "off the beaten path", (at least for me). Is it possible, in an ASP.NET application, using the code-behind page building technique, to have both pages written in VB.NET and pages written C#.NET?At http://www.WebLogicArts.com/DemoList.aspx there is a sample that shows that, (contrary to popular belief), it IS possible to mix ASP.NET pages built with C#.NET with ASP.NET pages built with VB.NET in the same VS.NET 2003 project. Note that this is just a "fun" sample to see if it can be done and I do not recommend this practice as a "standard" way of develo...

Loading COM Component into Registery/Accessing COM objects in .net
Hi All, Need your help to resolve my problem, I have a dll for a ChangeMangement tool (I guess this was developed using VB), when I try to register this dll, I am getting "Dll loaded, but DllRegistry entry point was not found" I am sure this dll is not corrupted one, bcz same dll I am able to refere in my server (where corresponding Tool is installed). Any one can help how to register this dll ? or how to find the dependent dlls for this? I am trying use the classes in this COM object, but when I refere in .Net and when I run the appl, I am getting CLSI was not loaded. ...

.Net 2.0 Web application using Vb.net is unable to create object of another dll writen in C# .net 2.0
Hi, I habe created one ASP.net web application using Vb.net which is adding reference of dlls written in C# and .net 2.0. But whenever trying to create object of referencing dll, it is throwing error :Object reference does not set to an object. But, locally it is working fine,. In the server i have deployed the .aspx files and dll files in the bin. There were already an web.config in the server which is of .net 1.1. But checked it is retrieving value for that web.config correctly. Should i have to deply any other files and if not what can be the solution for this? Please help. Thanks, So...

Generating WebPages Using Entity Objects
Hi everyone, I hope you can help. We currently have a web development system using Visual Studio 2005 that is based on an ntier architecture. The application uses entity objects in the middle tier to transform the datasets from the data layer into the corresponding elements and collections. At the moment however we are lacking a website that will help administrator the corresponding relations. So for example we have an entity in the database that is customers, so we want to generate the web pages using these entities so that we can administator the database table. ...

How well can Ajax and Javascript be used inside.Net application using C#?
In my experimentation with Ajax.Net I am not sure how far I can go with Ajax. NET and /or  javascript on the .NET platform. Is there anyone who had used these technologies exstensively who can tell me who well they can be used on .NET's platform? I guess what I am asking is...will using Ajax be like using ajax and or will using javascript be like using javascript when you use it on .NET's platform or will there be suttle diffrences?   thanks Allen    Ajax.net is basically just a javascript library like scriptaculous or others.  It has lo...

used a c#.net to vb.net converter and am now getting a syntax error.
ok I used a cool utility at http://www.kamalpatel.net/ConvertCSharp2VB.aspx to convert some c#.net to vb.net and it spit out a bunch of code which almost works but I am getting a syntax error on this line Imports (StreamReader sr = Shadows Function)() As StreamReader(objResponse.GetResponseStream()) I tried it that way and also like Imports (StreamReader sr = Shadows Function)() As StreamReader(objResponse.GetResponseStream()) but either way gave the same error Compiler Error Message: BC30035: Syntax error. Source Error: Line 26: Line ...

Accessing COM Objects on .NET
using EAS Server 4.2.2 for our web applications. I would like to access a COM object lying on a different webserver running ..Net on IIS. I have tried this before. I would appreciate if anyone could briefly outline the steps required to access the same Thanks You need to use the tlbexp utility to generate a COM typelib from the .NET assembly you're trying to access. You then use the TLB to register a COM proxy you can invoke from EAS. -- <hopethishelps/> Roy Kiesler [TeamSybase] SDN CodeXchange -- http://codexchange.sybase.com "Suresh" <...

How to use this javascript in C#.net
// addEvent function by John Resig: // http://ejohn.org/projects/flexible-javascript-events/ function addEvent( obj, type, fn ) { if ( obj.attachEvent ) { obj['e'+type+fn] = fn; obj[type+fn] = function(){obj['e'+type+fn]( window.event );} obj.attachEvent( 'on'+type, obj[type+fn] ); } } // Script for example event goes here addEvent(document.getElementById('myinput'), 'paste', function(event) { alert('You pasted some text'+document.getElementById('myinput').value); }); Hello all,  I&nb...

Web resources about - Accessing COM object written in C# using JavaScript - asp.net.getting-started

JavaScript Kit- Your comprehensive JavaScript, DHTML, CSS, and Ajax stop
Your comprehensive JavaScript, DHTML, CSS, and Ajax stop

Let's Code: Test-Driven Javascript by James Shore — Kickstarter
James Shore is raising funds for Let's Code: Test-Driven Javascript on Kickstarter! A screencast series focusing on rigorous, professional Javascript ...

Eloquent JavaScript: A Modern Introduction to Programming
... and pragmatics. I loved the tutorial-style game-like program development. This book rekindled my earliest joys of programming. Plus, JavaScript! ...

JavaScript - Wikipedia, the free encyclopedia
programming styles. JavaScript was formalized in the ECMAScript language standard and is primarily used in the form of client-side JavaScript ...

Open Directory - Computers: Programming: Languages: JavaScript: Tools: Obfuscators
... editor - report abuse/spam - help the entire directory only in Tools/Obfuscators Description Top : Computers : Programming : Languages : JavaScript ...

Facebook Open-Sources JavaScript Static-Type Checker Flow
The latest software to be open-sourced by Facebook is Flow , a static-type checker for JavaScript . (more…) New Career Opportunities Daily: ...

Under the Hood: The JavaScript SDK - The use of polyfills - Facebook
Facebook Engineering hat eine Notiz mit dem Titel Under the Hood: The JavaScript SDK - The use of polyfills geschrieben. Du kannst den vollständigen ...

JavaScript
The Facebook SDK for JavaScript provides a rich set of client-side functionality for adding Social Plugins, making API calls and implementing ...

Facebook App Devs Get Javascript
It has been an oft-lamented fact of the Facebook Platform thus far in its life that, in order to use all but the most simple of Javascript functionality–the ...

Badass JavaScript (@badass_js) on Twitter
WebGLWorker is an open source library that allows using WebGL from Web Workers. Great work as always from @kripken . blog.mozilla.org/research/2014/… ...

Resources last updated: 11/24/2015 4:04:54 PM