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!
I'm trying to use WebUI4Delphi to serve html documents from a database with about 60k documents. The wrapper is straightforward and easy to use. It also works as good as I ever hoped for, but... The special case is: I'm using a desktop app for selecting the documents and call Show() with a virtual URL that is going to be served from inside the filehandler.
When the user choses to close the WebUI window and selects another document afterwards, the window (with same ID as the window_id from previous calls) is reopened for a second and closes itself half a second later. The file handler is called with the new "virtual url" and then the app comes to a halt for about 10 seconds. No events are dispatched to my OnWebUIEvent function anymore.
Is there anything I have to do to "fix" the Window object after the user closes the window manually? And how do I find out if the Window object is in such state?
Hi,
It seems that there is an issue with using webui_set_file_handler in version 2.5.0 beta2. When returning resources with this, the page shows an ERR_INVALID_HTTP_RESPONSE, but this problem does not occur in version 2.4.2. Is this a bug in WebUI?