• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 502
  • Last Modified:

ActiveX component can't create object

I have created a simple app and registered it with regsvr32. I can access my interface within C++ and VB apps but not from within ASP. I get the following response in my browser:

Microsoft VBScript runtime error '800a01ad'
ActiveX component can't create object
logon.asp, line 27

My question is...what do I have to do different for ASP than what I do for C++ and VB?
0
awjacob
Asked:
awjacob
1 Solution
 
PepsterCommented:
what does your code look like?
0
 
ZizzerCommented:
As Pepster says, we'd need to see the code in order to be sure.

However, my hunch is that this is an early- vs. late-binding problem.  In VC++ and (probably) VB clients, you create the object via its CLSID; in ASP, you create the object via its ProgID.  The difference is this:

   Set x = new Foo    ' VB

as opposed to this:

   Set x = Server.CreateObject("Foo.1")   ' ASP

So my guess is that you're not specifying the correct ProgID when you call CreateObject() from your ASP page.

-- Zizzer
0
 
awjacobAuthor Commented:
LOGIN.ASP (extraneous code removed)
<%
  userid = UCase(Request.QueryString("userid"))
  password = UCase(Request.QueryString("password"))
  Set ta2000Security = Server.CreateObject("DicoreASP.TA2000Security")
  ta2000Security.Logon userid, password, ""
%>
0
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
awjacobAuthor Commented:
The ProgID is exactly as it appears in the registry key:
VersionIndependentProgID="DicoreASP.TA2000Security"
0
 
manojaminCommented:
0
 
awjacobAuthor Commented:
DicoreASP is a Visual C++ 6.0 application mostly generated via wizards. The project was created using the "ATL COM AppWizard." Server Type is DLL.

The TA2000Security object was created through the ATL Object wizard choosing the ActiveX Server Component taking all the default settings. I added the Logon as a method.

Is this the correct VC++ way to create an object for ASP?
0
 
rmgalanteCommented:
Does your COM Object support the IDispatch interface.  It has too if you want to access it from ASP land.
0
 
awjacobAuthor Commented:
DICOREASP.IDL:

import "oaidl.idl";
import "ocidl.idl";
  [
    object,
    uuid(B1EB26B1-9E94-11D3-B024-0004ACEB9028),
    dual,
    helpstring("ITA2000Security Interface"),
    pointer_default(unique)
  ]
  interface ITA2000Security : IDispatch
  {
    //Standard Server Side Component Methods
    HRESULT OnStartPage([in] IUnknown* piUnk);
    HRESULT OnEndPage();      
    [id(1), helpstring("method Logon")] HRESULT Logon([in] BSTR userid, [in] BSTR password, [in] BSTR newPassword);
  };

[
  uuid(B1EB26A4-9E94-11D3-B024-0004ACEB9028),
  version(1.0),
  helpstring("DicoreASP 1.0 Type Library")
]
library DICOREASPLib
{
  importlib("stdole32.tlb");
  importlib("stdole2.tlb");

  [
    uuid(B1EB26B2-9E94-11D3-B024-0004ACEB9028),
    helpstring("TA2000Security Class")
  ]
  coclass TA2000Security
  {
    [default] interface ITA2000Security;
  };
};
0
 
awjacobAuthor Commented:
manojamin,

I have read through the link you provided. Thank you. I have followed their instructions -- I have checked and rechecked my program's registration, I used Depends to see all my dependent dlls and have copied those to the same directory as my dicoreasp.dll, and that directory has read access to the Everyone group. I still get the same result.
0
 
awjacobAuthor Commented:
Adjusted points to 200
0
 
manojaminCommented:
I am trying to rebiuld your case, however for some reason, my ATL Wizrd does not show any Template objects.

Anyway, why don't you visit following site?

http://msdn.microsoft.com/workshop/server/asp/comp.asp#ASP-intrinsics

I saw one difference in your OnStartPage method. you are passing IUnknown and these guys are passing IDispatch. (thet are talking about VC 4.2 and 5.0 there)

I don't know if this will make a difference though as ultimately it's all IUnknown...

I would say just visit that page anyway, you might find something there..

0
 
deepaklakhaniCommented:
I had a similiar problem while using one upload component(caprockafu). Check the site suggested by manojamin ( i.e. http://support.microsoft.com/support/kb/articles/Q194/8/01.ASP ). This should be of good help .

( From the three problems mentioned in the article, I had a problem related to security )
0
 
awjacobAuthor Commented:
I removed all links to my security DLLs and hard-coded return codes and data in there place. The object is now callable by my vbscript. This leads me to believe that their is a DLL being called dynamically be my security DLLs.
0
 
awjacobAuthor Commented:
Sorry about the long wait to judge your answer. I was out on an extended Thanksgiving vacation...Good job!
0

Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now