That 's the way I call activex on my box and it works well,
<html>
<head>
<script language="javascript">
<!-- Load the ActiveX object -->
var x = new ActiveXObject("DimensionsClientsSystemInfo.AClass");
<!-- Access the Method -->
alert(x.MacID());
</script>
</head>
<body>
</body>
</html>
Hope the above information helps
Best Regards
XiaoYong Dai
Microsoft Online Community Support
Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
for that executed the commands regasm path/mydll.dll
regasm path/mydll.dll/tlb
gacutil mydll.dll
and when executed the web application I got the alert.
<script type="text/javascript" language="javascript">
<!-- Load the ActiveX object -->
var x = new ActiveXObject("DimensionsClientsSystemInfo.DimensionsClientsSystemInfo");
alert(x.MacID());
var XLApp = new ActiveXObject("Word.Application");
alert(XLApp.Version);
</script>
all works fine but when I published the web application and executed it from the server,the same error repeats
You can register the assembly in multiple ways of implementation and it mostly depends on the target users. For example, creating a setup file for download or having a self extractor file which could prompt in the browser, )
Another way is use COM class factory for component with CLSID ----e.g: {0006FB3A-0000-0000-C100-000001000046}, let the client browser to download the control for install
For more information, please view my post in this thread
Best Regards
XiaoYong Dai
Microsoft Online Community Support
Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
dim505
Member
2 Points
41 Posts
Active X control error"Automation server can't create object"
Feb 29, 2008 04:51 AM|LINK
hi friends,
My task is to "Write ActiveX Control for fetching MACID of client machine."
I'm new to this active X controls.I created a dll by choosing projects->class library
and created a dll.The code is as follows:
using
System;using
System.Runtime.InteropServices; namespace DimensionsClientsSystemInfo{
public interface ASignatures{
string MacID(); string ComputerName(); string IPAddress();}
[ClassInterface(ClassInterfaceType.AutoDual)] public class AClass : ASignatures{
public string MacID(){
return "xxx0001";}
public string ComputerName(){
return "DimensionsLiveO";}
public string IPAddress(){
return "124.125.133.74";}
}
}
my next step was to implement this dll in a web application using javascript.
For this I tried the following code:
<%
@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><
html xmlns="http://www.w3.org/1999/xhtml" > <head runat="server"><
object id="rtfcontrol" height="472" width="488" classid="Bin/DimensionsClientsSystemInfo.dll"></
object><
title>ActiveX</title> <script type="text/javascript" language="javascript">
var x = new ActiveXObject("AClass.dll");alert(x.MacID());
</script></
head><
body> <form id="form1" runat="server"> <div> <asp:Label ID="Label1" runat="server" Text="Label"></asp:Label></div> </form></
body> </html> but when running javascript error:"Automation Server can't create an object" results.is there any mistake in my code.I think my dll is working but error is in the aspx file.
can anyone help me.
I used the reference:http://dotnetslackers.com/articles/csharp/WritingAnActiveXControlInCSharp.aspx
dim505
siva_sm
Star
9409 Points
1375 Posts
Re: Active X control error"Automation server can't create object"
Feb 29, 2008 11:11 AM|LINK
Did you copy the assembly and also the type library for the assembly (created via tlb.exe) on to the target machine?
dim505
Member
2 Points
41 Posts
Re: Active X control error"Automation server can't create object"
Mar 03, 2008 10:23 AM|LINK
yes,but I get the same error
I altered the settings of IE.
"Tools > Internet options > Security > Custom Level
Under the ActiveX controls and plug-ins, select Enable for Initializing and Script ActiveX controls not marked as safe. "
executed the command
REGSVR32 SHIMGVW.DLL
but gets the same error.pls help me??????
XiaoYong Dai...
All-Star
38310 Points
4229 Posts
Re: Active X control error"Automation server can't create object"
Mar 04, 2008 02:14 AM|LINK
Hi
That 's the way I call activex on my box and it works well,
<html> <head> <script language="javascript"> <!-- Load the ActiveX object --> var x = new ActiveXObject("DimensionsClientsSystemInfo.AClass"); <!-- Access the Method --> alert(x.MacID()); </script> </head> <body> </body> </html>Hope the above information helpsXiaoYong Dai
Microsoft Online Community Support
Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
dim505
Member
2 Points
41 Posts
Re: Active X control error"Automation server can't create object"
Mar 06, 2008 08:47 AM|LINK
finally I got the script running.
for that executed the commands regasm path/mydll.dll
regasm path/mydll.dll/tlb
gacutil mydll.dll
and when executed the web application I got the alert.
<script type="text/javascript" language="javascript">
<!-- Load the ActiveX object -->
var x = new ActiveXObject("DimensionsClientsSystemInfo.DimensionsClientsSystemInfo");
alert(x.MacID());
var XLApp = new ActiveXObject("Word.Application");
alert(XLApp.Version);
</script>
all works fine but when I published the web application and executed it from the server,the same error repeats
"Automation server can' create object"
should I alter any another settings???
pls help.....
dim505
XiaoYong Dai...
All-Star
38310 Points
4229 Posts
Re: Active X control error"Automation server can't create object"
Mar 06, 2008 10:19 AM|LINK
Hi
One approch is copy the dll to each client machine and register using regasm.exe, then you will not receive create object error
(See quotes from http://dotnetslackers.com/articles/csharp/WritingAnActiveXControlInCSharp.aspx
You can register the assembly in multiple ways of implementation and it mostly depends on the target users. For example, creating a setup file for download or having a self extractor file which could prompt in the browser, )
Another way is use COM class factory for component with CLSID ----e.g: {0006FB3A-0000-0000-C100-000001000046}, let the client browser to download the control for install
For more information, please view my post in this thread
http://forums.asp.net/p/1192196/2059612.aspx#2059612
XiaoYong Dai
Microsoft Online Community Support
Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
Palanivelraj...
Member
2 Points
4 Posts
Re: Active X control error"Automation server can't create object"
Feb 29, 2012 04:53 AM|LINK
Dear All,
In the above example client is required dotnet framework where as in my context, it is not possible.
I want to write a activex control to fetch mac id of client in the web application without dotnet framework requirement at client side.
With Regards
Palanivelrajan
yrrkishore
Member
2 Points
1 Post
Re: Active X control error"Automation server can't create object"
Apr 13, 2012 02:55 PM|LINK
I had the similar error when creating scripting.filesystem object and got fixed by running regsvr32 scrrun.dll