Solved

Class creation error

Posted on 2006-10-20
5
326 Views
Last Modified: 2010-04-16
Hello,

Please help me why I am getting the error message, its really urgent.

bellow is the error message, which I am getting, I have defined a public class in a .vb file, which I am using trying to use.




Cannot create ActiveX component.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

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

Source Error:


Line 103:                                                            <td width="25%" align="right" height="40" valign="middle"><%
Line 104:                                                            dim HTTPSConfig as object
Line 105:                                                            HTTPSConfig = createobject("ThanXConfig")
Line 106:                                                            HTTPSConfig.IsHTTPS=false      '''''''Redirect to HTTPS
Line 107:                                                            if Request.ServerVariables("HTTPS")="off"  then
 

Source File: c:\inetpub\wwwroot\cart\viewcart.aspx    Line: 105

Stack Trace:


[Exception: Cannot create ActiveX component.]
   Microsoft.VisualBasic.Interaction.CreateObject(String ProgId, String ServerName) +231
   ASP.viewcart_aspx.__Render__control3(HtmlTextWriter __output, Control parameterContainer) in c:\inetpub\wwwroot\cart\viewcart.aspx:105
   System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +27
   System.Web.UI.HtmlControls.HtmlForm.RenderChildren(HtmlTextWriter writer) +44
   System.Web.UI.HtmlControls.HtmlForm.Render(HtmlTextWriter output) +262
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +243
   System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +72
   System.Web.UI.Control.Render(HtmlTextWriter writer) +7
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +243
   System.Web
 
0
Comment
Question by:davelalande
5 Comments
 

Author Comment

by:davelalande
Comment Utility
Hello,

Can anyone please tell me why I getting that error.

Regads,
0
 
LVL 41

Accepted Solution

by:
HonorGod earned 250 total points
Comment Utility
I don't know what the 'ThanXConfig" is supposed to be, and from the messsage, it would seem that neither does ActiveX.
0
 
LVL 1

Assisted Solution

by:Toby Riley
Toby Riley earned 250 total points
Comment Utility
When using com objects in .NET the best way is to register the COM object using regtlib (OCX,TLB) or RegSvr32.EXE (DLL) if not already done.

When you do this .NET creates a COM interop library that enables you to access the class using strong typing and normal class creation semantics.

i.e.

Register the component usng regtlib or regsvr32 (or both if required)
In the IDE open the add reference for the project
Select the COM tab
Select you component
Confirm everything and you should have a new reference in you project.

Now you can use the class browser to inspect it and create the class in a standard way.

i.e

Dim oObject as ThanXConfig.MyClass

'create object
oObject =  New ThanXConfig.MyClass(ConstructorArguments)

'call methods/functions
oObject.Method(Args)

'clean up
oObject.Dispose
oObject = Nothing

etc.

etc.

Hope that helps.

Regards

Toby.

0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

A short article about problems I had with the new location API and permissions in Marshmallow
Resolve DNS query failed errors for Exchange
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

762 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

7 Experts available now in Live!

Get 1:1 Help Now