Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 422239
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T19:03:43+00:00 2026-05-12T19:03:43+00:00

I am using reading the documentation for app domains in .net 3.5 and came

  • 0

I am using reading the documentation for app domains in .net 3.5 and came across SandboxInterop. The docs says

Gets or sets a value that indicates whether interface caching is disabled for interop calls in the application domain, so that a QueryInterface is performed on each call.

But why would I ever wish to disable the caching of QueryInterface?

(A quick google does not find anything that explains the way?)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T19:03:43+00:00Added an answer on May 12, 2026 at 7:03 pm

    In typical operation, there usually is little reason to worry about QueryInterface calls being cached.

    However, other parties may create components where the number of outstanding interfaces is tied to the operation of the component. In addition, there are also outliers where the interface received from a COM object has an implementation that may make it tougher to control the lifetime of the object.

    For example, components written in ATL may be created with tearoff interfaces. These tearoffs are not available in the binary layout of the main object, and are typically implemented on another hidden object that coordinates with its parent. Since a successful QueryInterface call implicitly counts as an AddRef call, the lifetime of the tearoff provider may be extended past its intended release if the interface reference is cached. Also, there may also be a case where an object only provides one tearoff of a particular interface with the intent that there is only one consumer at a time through that interface. A cached copy could violate that behavior if two consumers are issued the same copy when the intent is for the second request to fail.

    Finally, a more likely scenario is the possibility that each QueryInterface call is being tracked for debugging or logging purposes. Being able to turn off caching may allow someone to diagnose issues where occurrences could be delayed with it on.

    Here are some links on tearoff interfaces for your reference.

    ATL Tear-Off Interfaces @ CodeGuru

    CComTearOffObject Class @ MSDN

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I recall reading somewhere that using references to smart pointers can cause memory corruption.
With the following file reading code: using (FileStream fileStream = new FileStream(fileName, FileMode.Open, FileAccess.Read,
I am looking for a method of reading emails using Pop3 in C# 2.0.
When reading lines from a text file using python, the end-line character often needs
After reading the Head First Design Patterns book and using a number of other
I am reading image files in Java using java.awt.Image img = Toolkit.getDefaultToolkit().createImage(filePath); On some
After reading this discussion and this discussion about using CrashRpt to generate a crash
I was reading an article on MSDN Magazine about using the Enumerable class in
I've tried reading a JPG file using the StreamReader class' ReadToEnd() method which returns
Using Python, how would I go about reading in (be from a string, file

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.