Hi friends,
I am using Delphi 7.
My application has some functions it imports from one of my DLLs.
In this dll I am creating a NON-VISUAL componet which does some parsing for
me and return the parsed string.
I am receive "EOutOfMemory" errors in Windows.
I have traced this problem to reside in the DLL and with the component I
create.
BTW this functions gets called 1000 of times.
According to me I am creating the NON-VISUAL component and FREE-ing it
correctly but apparently I am unders a mis-conception :).
Here is the code in DLL where I create non visual component.
---------------CODE BEGINS----------------
Function ParseString(wsStringToParse :WideString) :WideString;
var
Comp :TComponent
begin
Comp := TComponent.Create(nil);
Try
Comp.StringToParse := wsStringToParse;
Comp.DoParsing;
Result := Comp.ParsedString.Text;
Finally
FreeAndNil(Comp);
end;
end;
---------------CODE ENDS------------------
Please advice.
Thanks in advance!