Microsoft Knowledge Base Email Alertz

(243603) - When calling third-party Component Object Model (COM) components either directly from Active Server Pages (ASP) or indirectly through ASP using COM wrappers, the component does not behave as expected. The component may work correctly when called...

Search KbAlertz

Advanced Search

Receive Microsoft Knowledge Base articles by E-Mail?

Every night we scan the Microsoft Knowledge Base. If technologies you're interested in are updated, we'll send you an e-mail. You only get one e-mail a day, and only when new articles are added.

Click here to create a
FREE account
Already have an account?
[Click here to Login]











Microsoft Knowledge Base Article

This article contents is Microsoft Copyrighted material.
©2005-©2007 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks

Article ID: 243603 - Last Review: November 15, 2006 - Revision: 4.1

PRB: Calling Third-Party Component Fails from Active Server Pages

This article was previously published under Q243603

SYMPTOMS

When calling third-party Component Object Model (COM) components either directly from Active Server Pages (ASP) or indirectly through ASP using COM wrappers, the component does not behave as expected. The component may work correctly when called from a desktop client such as a Visual Basic or Visual C++ client form.

CAUSE

Many components are not designed to be called from ASP or to run in a multi-threaded environment under a service.

MORE INFORMATION

Typically one or more of the following issues may cause third-party components to fail or behave unexpectedly when called under ASP:
  • The component was designed for desktop use.
  • The component requires a specific security context.
  • The component requires a user interface or a host container.
  • The component was not designed to be used in a multi-threaded environment
  • The component expects a single thread of execution.
In general, you should use the following guidelines:
  1. Confirm with the development company of the third-party component that the component is designed to work under ASP.
  2. Confirm that the threading model of the component is safe for use under ASP. Single threaded components should not called from ASP because they do not marshal security context, and they lock the application down to a single thread of execution. Only Apartment (STA), Free, and Both threaded components can be used safely from ASP.
  3. Confirm that the component implements IDispatch. Working from ASP includes implementing IDispatch and the component needs to be thread-safe because ASP is a multi-threaded automation client.

    Tip: If the third-party component information is not available directly from the development company, you can call the component from a Visual Basic client using late-binding (for example, Dim objServer as Object) to test IDispatch functionality. You can also inspect the registry for type information.
In general, Microsoft support boundaries include the following:
  1. Explaining the behavior of ASP as a multithreaded COM client:
    • Security implications running under Internet Information Server (IIS) as opposed to a desktop application
    • Threading guidelines under ASP
    • Scalability issues
  2. Assisting in problem isolation to determine if the problem lies within the third-party component.

REFERENCES

243548  (http://kbalertz.com/Feedback.aspx?kbNumber=243548/EN-US/ ) INFO: Design Guidelines for VB Components Under ASP

APPLIES TO
  • Microsoft Active Server Pages 4.0, when used with:
    • Microsoft Internet Information Server 3.0
    • Microsoft Internet Information Server 4.0
Keywords: 
kb3rdparty kbprb kbthread KB243603
       

Community Feedback System

Very often, it takes hours to solve a problem. Very often, you've looked high and low, and have tried a lot of solutions. When you finally found it, chances are, it was because someone else helped you. Here's your chance to give back. Use our community feedback tool to let others know what worked for you and what didn't.

Please also understand that the community feedback system is not warranted to be correct, it's simply a system that we've built to let people try and help each other. If something in a feedback response doesn't make sense to you, or you're not comfortable making changes that the feedback talks about (like registry edits), please consult a professional.

Thank you for using kbAlertz.com Feedback System.

-- Scott Cate