Board index » delphi » can not save a datamodule referencing the main webmodule?
Andrea Raimondi
![]() Delphi Developer |
Can't save a datamodule referencing the main webmodule?2004-08-23 12:52:14 AM delphi259 Hi Peers, When I try to save this module: ------------------------------------------------------------------ unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, BasePageCode, DB, IBCustomDataSet, IBQuery; type TpgDefault = class(TDMBasePage) private { Private declarations } protected function GetPageContent : String;override; public { Public declarations } end; var pgDefault: TpgDefault; implementation {$R *.dfm} end. ----------------------------------------------------------------- I got this message: "Module 'pgDefault' links to module 'wmMain' which cannot be found in the current project. Do you wish to remove/redirect the links to another module?" If I press "no" here is what Delphi says: "Module 'pgDefault' references another module and cannot be saved until wmMain is loaded". You might be wondering where that reference comes from. Well, it is in the ancestor datamodule and it is declared like this: ----------------------------------------------------------------------- unit BasePageCode; interface uses SysUtils, Classes, DB, IBCustomDataSet, IBQuery, HTTPApp, wmMainCode; type TDMBasePage = class(TDataModule) private function GetWebMod: TWebModule; { Private declarations } protected // Irrelevant stuff here public { Public declarations } // Irrelevant stuff property WebMod : TWebModule read GetWebMod; end; // Irrelevant other stuff var DMBasePage: TDMBasePage; implementation {$R *.dfm} { TDMBasePage } // Irrelevant stuff function TDMBasePage.GetWebMod: TWebModule; begin Result := wmMain; end; // Irrelevant stuff end. ------------------------------------------------------------------------- I honestly didn't try to click "Yes" yet, but I find this behaviour quite weird. I assume that - probably - unloading the webmodule would do the trick, but then I wonder what the problems may be at runtime or next time I start the IDE... any solution worth considering? TIA, Andrew |