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

  • SEARCH
  • Home
  • 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 5961801
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T19:01:01+00:00 2026-05-22T19:01:01+00:00

This is a very simple setup, I can’t believe but I didn’t find anybody

  • 0

This is a very simple setup, I can’t believe but I didn’t find anybody with the same problem so far…

Create a .Net4 class library in VS2010. Create a simplest possible COM object:

[ComVisible(true)]
[Guid("CD157EBC-C89D-40b6-B531-E85FF4B3AE9A")]
[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
public interface IAcorn
{
    bool Foo(string moo);
}


[ComVisible(true)]
[ClassInterface(ClassInterfaceType.None)]
[Guid("854B7690-C1C4-40c4-8059-B4F3450B30D0")]
public class Acorn : IAcorn
{
    public Acorn()
    {
    }

    public bool Foo(string moo)
    {
        return true;
    }
}

Set “Register for COM interop” option for the assembly. Set “platform target” to x86.

Create a Win32 client using Delphi, import the object, instantiate it using normal instantiation (translates to
CoCreateInstance(ClassID, nil, CLSCTX_INPROC_SERVER or
CLSCTX_LOCAL_SERVER, IUnknown, Result))

Run the Win32 application, everything works fine.

Try to debug the COM object from VS2010. Set the class library Debug option to start an external program, point to the executable you just created. When you launch the Win32 app from VS210, the program crashes (with StackOverflow) at the attempt to instantiate the COM.

Change the Target framework to .Net 3.5 Launch the debugging from VS2010, everything works including debugging.

Note – This is also a problem when using either CLR Hosting or unmanaged export COM instantiation. Both methods work with .Net4 but debugging is not possible.

The question is standard – why does this happen and is there a workaround?

  • 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-22T19:01:01+00:00Added an answer on May 22, 2026 at 7:01 pm

    The .NET framework and Delphi may set or expect different values in the FPU control word.

    That problem can be avoided by setting the register explicitly, before calling .NET code and resetting it after the .NET code is done:

    How can I set and restore FPU CTRL registers?

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

Sidebar

Related Questions

I was making this very simple lex program (just an introductory program). But on
I have fully isolated this problem to a very simple play app I think
My Bootstrap setup is very simple and quite similar to this example . I've
I have this strange, yet maybe very simple problem.. I have a timer1 in
I am trying something very simple but somehow I can't get it to work.
This is probably a simple fix... but I can't get validation to work. I've
I'm sure this will be very simple for you experts. SUDZC is set up
This very simple code: #include <iostream> using namespace std; void exec(char* option) { cout
In this very simple code example, messages get lost every once in a while.
I have this very simple jQuery function: $(.milestone-in-tree).live({ mouseenter: function() { setTimeout( $.ajax({ type:

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.