Com objects made with .net 2.0

Com objects made with .net 2.0

Post by Dimitar St » Wed, 19 Dec 2007 18:41:11


I have a problem with creating a COM object with RAD Studio 2007 .NET . this
is the sample:


IrdmA = interface
function GetStr : string;

TrdmA = class(TObject, IrdmA)
constructor Create();
function GetStr : string;

The instatiation of the COM object is made by a win32 delphi application and
an error "Access Violation at 0x78158984: write of address 0x00030ffc" is
raised. Strange but if the instantiation is made by a .net appication,
everithing is working fine.I investigated the problem and found that if I
comment out Classes unit from uses section the COM object is created
successfully. But I need Classes unit in my real application...

Can you tell me, what should I do?

Thanks in advance.

Dimitar Stoyanov

Com objects made with .net 2.0

Post by Marc Rohlo » Wed, 19 Dec 2007 23:12:47


So, in your sample you get the error just by using 'classes' and not
actually using any functions in it? Then it must be something in the
initialization section of 'classes' or one of the units it uses.
You could test this by making a copy and commenting out code

The simplest solution seems to be to just copy the methods you need
out of classes into a new unit.

Marc Rohloff [TeamB]
marc -at- marc rohloff -dot- com