Solved

Class creation error

Posted on 2006-10-20
5
327 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
ID: 17773337
Hello,

Can anyone please tell me why I getting that error.

Regads,
0
 
LVL 41

Accepted Solution

by:
HonorGod earned 250 total points
ID: 17781759
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
ID: 17857600
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

Are your AD admin tools letting you down?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

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

Suggested Solutions

Disabling the Directory Sync Service Account in Office 365 will stop directory synchronization from working.
In this article, I am going to show you how to simulate a multi-site Lab environment on a single Hyper-V host. I use this method successfully in my own lab to simulate three fully routed global AD Sites on a Windows 10 Hyper-V host.
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 fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

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