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 7414379
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T07:05:27+00:00 2026-05-29T07:05:27+00:00

i trying to call a COM-Object which is described here Is it possible to

  • 0

i trying to call a COM-Object which is described here

Is it possible to package WPF window as COM Object

from a Delphi App.

After importing the tlb, i’m using this code to call that COM Object.

var
  y: ITestWpfInterface;
begin
  y:=CreateComObject(CLASS_TestWpfInterface) as ITestWpfInterface;
  y.TestWpf();
end;

the COM Object gets instantiated and the method is called.
but the COM Objects crashes the Delphi app, when it is reaching the

Window1 form = new Window1();

line. when i’m trying to do the same from word-VBA the wpf windows is show.

Sub test()
  Dim x As New WpfControlLibrary1.TestWpfInterface
  x.TestWpf
End Sub

catch blocks around the new window does not show any exceptions.
i have debugged the application with windbg. it shows me a div by 0 exception, after loading the framework wpf assembly’s

why does the delphi app crash? what causes the crash. how to solve it?

edit:
this is the output from windbg

ModLoad: 76330000 7634d000   C:\WINDOWS\system32\IMM32.DLL
ModLoad: 5b0f0000 5b128000   c:\windows\system32\uxtheme.dll
ModLoad: 75250000 7527e000   C:\WINDOWS\system32\msctfime.ime
ModLoad: 76f90000 7700f000   C:\WINDOWS\system32\CLBCATQ.DLL
ModLoad: 77010000 770e3000   C:\WINDOWS\system32\COMRes.dll
ModLoad: 79000000 7904a000   C:\WINDOWS\system32\mscoree.dll
ModLoad: 603b0000 60417000   C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\mscoreei.dll
ModLoad: 76970000 76a21000   C:\WINDOWS\system32\sxs.dll
ModLoad: 79140000 797ae000   C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\clr.dll
ModLoad: 79060000 7911e000   C:\WINDOWS\system32\MSVCR100_CLR0400.dll
ModLoad: 77f40000 77fb6000   C:\WINDOWS\system32\SHLWAPI.dll
(2b4.244): Unknown exception - code 04242420 (first chance)
ModLoad: 79880000 7a641000   C:\WINDOWS\assembly\NativeImages_v4.0.30319_32\mscorlib\a774bd593b8420bae4a8cf1d46af3ba2\mscorlib.ni.dll
ModLoad: 60340000 6034d000   C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\culture.dll
ModLoad: 60930000 60940000   C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\nlssorting.dll
ModLoad: 03270000 03549000   C:\WINDOWS\system32\xpsp2res.dll
ModLoad: 79810000 79870000   C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\clrjit.dll
ModLoad: 7a830000 7b0dd000   C:\WINDOWS\assembly\NativeImages_v4.0.30319_32\System\5286fe2d0167eb835a9f11025f1cb756\System.ni.dll
ModLoad: 58c20000 58fd1000   C:\WINDOWS\assembly\NativeImages_v4.0.30319_32\WindowsBase\9dacf8a5033dfbcb435be166d2f42cdf\WindowsBase.ni.dll
ModLoad: 68000000 68036000   C:\WINDOWS\system32\rsaenh.dll
ModLoad: 55590000 5607d000   C:\WINDOWS\assembly\NativeImages_v4.0.30319_32\PresentationCore\8244412387a82c0acd3d63622e22cef5\PresentationCore.ni.dll
ModLoad: 56980000 57aad000   C:\WINDOWS\assembly\NativeImages_v4.0.30319_32\PresentationFramewo#\813a0913bea1269e48613509609e72b4\PresentationFramework.ni.dll
ModLoad: 561c0000 562a1000   C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\WPF\wpftxt_v0400.dll
ModLoad: 55000000 5519a000   C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\WPF\wpfgfx_v0400.dll
ModLoad: 554c0000 55585000   C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\WPF\PresentationNative_v0400.dll
ModLoad: 59200000 593b5000   C:\WINDOWS\assembly\NativeImages_v4.0.30319_32\System.Xaml\a3ffdc1316821b5ceb32c9a788334329\System.Xaml.ni.dll
ModLoad: 60c90000 60d83000   C:\WINDOWS\assembly\NativeImages_v4.0.30319_32\System.Configuration\4844dd28e0611d1ebd1e449fe822c2a5\System.Configuration.ni.dll
ModLoad: 69760000 69cbe000   C:\WINDOWS\assembly\NativeImages_v4.0.30319_32\System.Xml\419103071a5a5d17738afbe9dd03d58a\System.Xml.ni.dll
(2b4.244): Unknown exception - code c0000090 (first chance)
(2b4.244): Unknown exception - code c0000090 (first chance)
(2b4.244): Unknown exception - code c0000090 (first chance)
eax=000000c0 ebx=00007530 ecx=001b1e30 edx=00000020 esi=00000000 edi=0374ff50
eip=7c91e514 esp=0374ff20 ebp=0374ff78 iopl=0         nv up ei pl nz na pe nc
cs=001b  ss=0023  ds=0023  es=0023  fs=003b  gs=0000             efl=00000206
ntdll!KiFastSystemCallRet:
7c91e514 c3              ret

a German version of this question inclusive sample code can found here:
http://www.delphipraxis.net/166199-com-interop-mit-einer-c-library-mit-wpf-und-com.html

  • 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-29T07:05:28+00:00Added an answer on May 29, 2026 at 7:05 am

    delphi doesn’t mask the exception from the wpf which are raised in the fpu.

    by setting a exception mask, the fpu ignores these exceptions.

    SetExceptionMask(
        [exInvalidOp, exDenormalized, exZeroDivide, 
        exOverflow, exUnderflow, exPrecision]
    );
    

    this function is located in the math unit.

    http://docwiki.embarcadero.com/VCL/en/Math.SetExceptionMask

    thanks goes to Bernhard Geyer, who had this idea.

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

Sidebar

Related Questions

I am trying to call a COM object from PHP using the COM interop
I'm trying to call Error(My Test) in normal cpp class (Not a COM object,
I am trying to get the code found here: http://snipplr.com/view/26643/mbprogresshud-with-an-asynchronous-nsurlconnection-call/ to work in my
I am trying to write a logger object which logs messages to screen. here
I am trying to dynamically create COM object, call COM method and set COM
I'm trying to call a function after I load some XML into Actionscript, and
I'm trying to call a web service from Excel 2003 module. The way i've
I'm trying to understand what is the correct why to implement COM interfaces from
I am writing an application based on a COM object from a third party
I am trying to retrieve data in a JSON object (which I have validated

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.