Microsoft KB Archive/191979

= PRB: VB Component Not Marked Apartment Produces ASP 0115 Error =

PSS ID Number: 191979

Article Last Modified on 12/1/2003

-

The information in this article applies to:


 * Microsoft Active Server Pages
 * Microsoft Visual Basic Learning Edition for Windows 5.0
 * Microsoft Visual Basic Professional Edition for Windows 5.0
 * Microsoft Visual Basic Enterprise Edition for Windows 5.0

-



This article was previously published under Q191979



SYMPTOMS
When instantiating an ActiveX dynamic-link library (DLL) created with Visual Basic 5.0 within an Active Server Page using the Server.CreateObject, the following error may occur:

Error 'ASP 0115'

Unexpected error

//

A trappable error occurred in an external object. The script cannot continue running.



RESOLUTION
Apply Visual Studio 97 Service Pack 3 or later to Visual Basic 5.0 and recompile the ActiveX DLL.

NOTE: Applying the latest version of the service pack will also apply fixes from the previous versions of the service pack.

Use the following steps to recompile the ActiveX DLL in Visual Basic with the latest service pack:


 * 1) Open the ActiveX DLL project.
 * 2) From the menu, select Project and go into  Properties where  is the name of the ActiveX DLL project.
 * 3) In the  - Project Properties dialog box, click the General tab.
 * 4) Go to the Threading Model frame and choose Apartment Threaded in the combo box. Click OK.
 * 5) Recompile ActiveX DLL component and apply it back to the Web server.
 * 6) Register the ActiveX DLL component on the Web server using RegSvr32.exe, if necessary.

NOTE: Apartment-model threading is the recommended threading model for components that will be called by Active Server Pages.

