Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"MARSWebServer" compile error #97

Open
frankwu-delphi opened this issue Sep 18, 2020 · 1 comment
Open

"MARSWebServer" compile error #97

frankwu-delphi opened this issue Sep 18, 2020 · 1 comment

Comments

@frankwu-delphi
Copy link

frankwu-delphi commented Sep 18, 2020

"MARSWebServer" compile error.

Steps to reproduce the behavior:

  1. Open /demos/MARSWebServer with delphi 10.4.1
  2. F9 ...
  3. See error 1:
    [dcc32 Error] Server.Forms.Main.pas(93): E2010 Incompatible types: 'TBeforeHandleRequestProc' and 'Procedure'

Comment out block:
{*
// skip favicon requests (browser)
FEngine.BeforeHandleRequest :=
function (const AEngine: TMARSEngine;
const AURL: TMARSURL; const ARequest: TWebRequest; const AResponse: TWebResponse;
var Handled: Boolean
): Boolean
begin
Result := True;
if SameText(AURL.Document, 'favicon.ico') then
begin
Result := False;
Handled := True;
end
end;
*}

  1. F9, See error 2:
    [dcc32 Error] Server.Resources.pas(46): E2250 There is no overloaded version of 'TMARSResourceRegistry.RegisterResource<Server.Resources.THelloWorldResource>' that can be called with these arguments

code:
initialization
TMARSResourceRegistry.Instance.RegisterResource(
function: TObject
begin
Result := THelloWorldResource.Create;
end
);

@stuartclennett
Copy link
Contributor

Frank, the problem is the TWebRequest and TWebResponse params - they need replacing with IMARSRequest & IMARSResponse.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants