Quantcast
Channel: Embarcadero Community - Embarcadero Community
Viewing all articles
Browse latest Browse all 3212

Using .NET assembly via COM throw Floating point invalid operation exception in Delphi.

$
0
0

Hello, I have some problem upon using .NET assembly via COM in Delphi.

How to reproduce:

Please, create simple .NET Class Library, with some test method, inside the method set Double test = Double.Nan

using System;

namespace DoubleNan

{

    public class TestClass

    {

        public TestClass() {}

        public void TestMethod()

        {

            Console.WriteLine("Start1");

            double test = Double.NaN;

            Console.WriteLine("End1");

        }

    }

}



Make assembly COM visible, sing it and register in GAC.

Then try to use this assembly inside Delphi, like this:

var  testClass: OleVariant;

 

CoInitialize(nil);

testClass := CreateOleObject('DoubleNan.TestClass');

testClass.TestMethod;

CoUninitialize;

Please let me know if you need more details. 

Waiting for your response.

Best regards, Andrey.

 


Viewing all articles
Browse latest Browse all 3212

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>