08-02-2018, 11:41 PM
(This post was last modified: 08-02-2018, 11:42 PM by Alexandre Machado.)
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
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