The .NET ActiveX component with WPF content can't be loaded by non MFC app
        Posted  
        
            by lonelyflyer
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by lonelyflyer
        
        
        
        Published on 2010-04-14T01:48:25Z
        Indexed on 
            2010/04/14
            1:53 UTC
        
        
        Read the original article
        Hit count: 440
        
I have a legacy delphi program and want to add some content implemented with WPF. So I encapsulate the WPF control with a .NET/ActiveX interop technology. That means something like: 
[ComRegisterFunction()]
public static void RegisterClass(string key);
[ComUnregisterFunction()]
public static void UnregisterClass(string key);
The activeX component is a WinForms User Control and the WPF materials are attached to an ElemenHost in this User Control.
It works fine if the host app of this ActiveX is a MFC program even without /clr switch. But my legacy app is a delphi program, and it always throw a stackoverflow exception within the constructor of my WPF user control as the program be started.
I have no clue, Google is no help. and it has puzzled me for days.
© Stack Overflow or respective owner