Board index » delphi » can not save a datamodule referencing the main webmodule?

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
 
 

Re:Can't save a datamodule referencing the main webmodule?

Andrea Raimondi writes:
Quote
any solution worth considering?
Add the parent page module to the project, and then open it up in the
designer.
--
Nick Hodges -- TeamB
Lemanix Corporation -- www.lemanix.com
Read my Blog -- www.lemanix.com/nick
 

Re:Can't save a datamodule referencing the main webmodule?

Nick Hodges [TeamB] writes:
Quote
Add the parent page module to the project, and then open it up in the
designer.
Er... it *is* in the project and I *did* open it up to the
designer... that is my problem!
Cheers,
Andrew
 

Re:Can't save a datamodule referencing the main webmodule?

Andrea Raimondi writes:
Quote
Er... it is in the project and I did open it up to the
designer... that is my problem!
Oh, sorry. In that case, I can not say why it doesn't work, sorry.
Have you tried it with a simple example? Start from scratch and see if
it works.
--
Nick Hodges -- TeamB
Lemanix Corporation -- www.lemanix.com
Read my Blog -- www.lemanix.com/nick