By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,276 Members | 1,312 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,276 IT Pros & Developers. It's quick & easy.

Cannot create ActiveX component in ASP.net but it is OK in command prompt vbc

P: n/a
Hi

I am using third party COM component which come with an installation
program (.exe file included). The program will be register to registry
automatically upon installation.

There is no problem calling the COM component from VB.net Module from
DOS Command Prompt :

Imports System
Imports Microsoft.VisualBasic

Module Module1
Sub Main()
Try
test()
Catch ex As Exception
Console.WriteLine(ex.StackTrace)
End Try

End Sub

Sub test()
Console.WriteLine("*** Start of Testing COM component")

Dim request As Object = CreateObject("Equx.EquxRequest")
Dim res as String = request.getResult()
Console.WriteLine(res)
End Sub

End Module
From Visual Studio.net, I added Reference to Equx.tlb file
and put Imports Equx, copy+paste test() method
But the same code failed to perform after I to ASP.NET Page_Load

Exception Details: System.Exception: Cannot create ActiveX component.

Source Error: Dim request As Object = CreateObject("Equx.EquxRequest")

If I change the above line to :
Dim request As Equx.EquxRequest = new Equx.EquxRequest
the error says that the factory can not create the object.

I am quite new in COM/VB
Please help...
Nov 18 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Check the permissions on this file. With a console application, the
application runs with your user credentials, and they obviously have
permission to use that file. With ASP.NET, the application runs with
different credentials (by default the ASPNET account, which is created when
you install the framework), and if this account doesn't have rights to get
to this file, then it is going to fail.

--
Chris Jackson
Software Engineer
Microsoft MVP - Windows Client
Windows XP Associate Expert
--
More people read the newsgroups than read my email.
Reply to the newsgroup for a faster response.
(Control-G using Outlook Express)
--

"Zhou Jingxiong" <ji************@yahoo.com.sg> wrote in message
news:89*************************@posting.google.co m...
Hi

I am using third party COM component which come with an installation
program (.exe file included). The program will be register to registry
automatically upon installation.

There is no problem calling the COM component from VB.net Module from
DOS Command Prompt :

Imports System
Imports Microsoft.VisualBasic

Module Module1
Sub Main()
Try
test()
Catch ex As Exception
Console.WriteLine(ex.StackTrace)
End Try

End Sub

Sub test()
Console.WriteLine("*** Start of Testing COM component")

Dim request As Object = CreateObject("Equx.EquxRequest")
Dim res as String = request.getResult()
Console.WriteLine(res)
End Sub

End Module
From Visual Studio.net, I added Reference to Equx.tlb file
and put Imports Equx, copy+paste test() method
But the same code failed to perform after I to ASP.NET Page_Load

Exception Details: System.Exception: Cannot create ActiveX component.

Source Error: Dim request As Object = CreateObject("Equx.EquxRequest")

If I change the above line to :
Dim request As Equx.EquxRequest = new Equx.EquxRequest
the error says that the factory can not create the object.

I am quite new in COM/VB
Please help...

Nov 18 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.