Newsgroups : Borland : borland.public.delphi.nativeapi.win32 : 2006 Jan : Create Non-visual component in DLL

www.cryer.info
Managed Newsgroup Archive

Create Non-visual component in DLL

Subject:Create Non-visual component in DLL
Posted by:"Codeman II" (thegentlem..@webmail.co.za)
Date:Fri, 20 Jan 2006 12:49:35 +0200

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!

Info

Glossary

Replies:

www.cryer.info
Managed Newsgroup Archive