When I want to export a class within a DLL, is it the right approach to derive it from an interface and return that interface by an exported function?
//exported dll function, which is used in the exe.
function MyClass_Create: IMyClass;
begin
result := TMyClass.Create;
end;
What about the memory management? Can I than pass in/out different interfaces and strings without worries and crashes?
IMyClass = interface
procedure SetString(aMsg: string);
function GetString: string;
procedure SetClass(aClass: ITestClass);
function GetClass: ITestClass;
end;