I tried following this document about how to build a non-visual component for TMS WEB Core, but it's not working.
This is my full unit code:
unit MyTestCustomComponents;
interface
uses
System.SysUtils, System.Classes, WebLib.Controls;
type
[ComponentPlatforms(TMSWebPlatform)]
TMyWebComponent = class(TComponent)
private
{ Private declarations }
protected
{ Protected declarations }
public
{ Public declarations }
published
{ Published declarations }
end;
procedure Register;
implementation
procedure Register;
begin
RegisterComponents('My Web Test Components', [TMyWebComponent]);
end;
end.
I'm able to successfully compile my .bpl package file and install it into my Delphi IDE. I'm also then able to find the component in my component palette and place it onto my form.
But as soon as I compile my web app with my custom component on it, then I get an error in my component unit:
[Error] MyTestCustomComponents.pas(9): identifier not found "TMSWebPlatform"
It's not finding TMSWebPlatform. I have WebLib.Controls on my uses just like the document explains and I have the attribute [ComponentPlatforms(TMSWebPlatform)] in there.
What am I doing wrong? Why is my custom non-visual component not working and finding TMSWebPlatform?