Subj : Acces Violation mixing a simple BC and Delphi units To : borland.public.cpp.borlandcpp From : kokok_kokok Date : Tue Jun 01 2004 02:54 pm I get Access Violation error when I try to get the TMember record (struct in C) of a Delphi Unit using the GetEmptyMember() function in my CPP code. The example is shown in this message and it is very short. I think that the code is ok and I cannot see the problem. Thanks in advanced ------------ Delphi Unit: ------------ unit UnitDelphi; interface type TMember = record id : integer; items : longint; rate : double; name : string; subname : string[255]; tag : boolean; end; function GetEmptyMember(): TMember; implementation function GetEmptyMember(): TMember; var a:TMember; begin a.name:='empty'; Result := a; end; end. ---------------------- C++ Code ---------------------- TMember p; p=GetEmptyMember(); ********************** .