salvadordf/WebUI4Delphi

Hello, could you please modify the return value of TWebUIFileHandlerCallback to support resources other than strings!

Closed this issue · 1 comments

Hello, could you please modify the return value of TWebUIFileHandlerCallback to support resources other than strings? You can change the return value to Pointer, so it can support images, videos, or other types of files.

//in uWebUITypes TWebUIFileHandlerCallback = function(const filename: PWebUIChar; len: PInteger): PWebUIChar; cdecl; //change to : TWebUIFileHandlerCallback = function(const filename: PWebUIChar; len: PInteger): Pointer; cdecl;
Then I can use in SetFileHandler like this:
ResStream := TResourceStream.Create(HInstance, pansichar(tmpstr), RT_RCDATA); len^ := ResStream.Size; LRsltBuffer := webui_malloc(len^); ResStream.ReadBuffer(LRsltBuffer^, len^); Result := LRsltBuffer;
I have tested, it worked fine!

Thanks for reporting this issue!

The last update includes the correct TWebUIFileHandlerCallback return type.