WebUI4Delphi is a WebUI wrapper, which allows you to use any web browser as a GUI, with Delphi or Lazarus/FPC in the backend and HTML5 in the frontend.
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!
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!