Link to home
Start Free TrialLog in
Avatar of awjacob
awjacob

asked on

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?
Avatar of Pepster
Pepster

what does your code look like?
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
Avatar of awjacob

ASKER

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, ""
%>
Avatar of awjacob

ASKER

The ProgID is exactly as it appears in the registry key:
VersionIndependentProgID="DicoreASP.TA2000Security"
ASKER CERTIFIED SOLUTION
Avatar of manojamin
manojamin

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of awjacob

ASKER

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?
Does your COM Object support the IDispatch interface.  It has too if you want to access it from ASP land.
Avatar of awjacob

ASKER

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;
  };
};
Avatar of awjacob

ASKER

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.
Avatar of awjacob

ASKER

Adjusted points to 200
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..

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 )
Avatar of awjacob

ASKER

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.
Avatar of awjacob

ASKER

Sorry about the long wait to judge your answer. I was out on an extended Thanksgiving vacation...Good job!