Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
ServerInternalFiles Access Location
#2
Hi,

unit is IWServerInternalFiles.pas. It implements TIWServerInternalFiles class which handles a list of resources kept in streams (TMemoryStream instances).

It is accessible via gInternalFiles instance declared in the same unit.

You can add custom memory streams to the list like:

procedure AddStream(aStream: TMemoryStream; AResName, AFileName: string);

You need to provide a unique AResName and a AFileName which can be basically anything. Example:

gInternalFiles.AddStream(MyMemStream, 'MY_TEMPLATE', 'mytemplate');

then you retrieve it using ResourceAsStream Method like

myStream := gInternalFiles.ResourceasStream('MY_TEMPLATE');

You are responsible for freeing myStream instance. However, if you intend to use it in a template, it doessn't need to be freed (the tamplate engine frees it for you).

Please let me know if you need further help
Reply


Messages In This Thread
ServerInternalFiles Access Location - by joel - 08-02-2018, 12:07 PM
RE: ServerInternalFiles Access Location - by Alexandre Machado - 08-02-2018, 11:41 PM
RE: ServerInternalFiles Access Location - by joel - 08-21-2018, 01:40 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)