Jump to content

UniMainModule declaration


Guest

Recommended Posts

Message from: "Junior/RO"

 

Hi Farshad. I have found a sample code where UniMainModule() is declared as:

 

function UniMainModule: TUniMainModule;

begin

if UniApplication <> nil then

Result := TUniMainModule(UniApplication.UniMainModule)

else

Result := TUniMainModule(VCLMainModule);

end;

 

Is this necessary? Can you please tell me the effects of using this?

 

--

Que é essa vida se, com tanto a fazer, não temos tempo para parar e ver?

.

 

Link to comment
Share on other sites

Message from: "Farshad Mohajeri"

 

"Junior/RO" wrote in message

news:ktjZFicnLHA.232@anaxagvs227...

> Hi Farshad. I have found a sample code where UniMainModule() is declared

> as:

>

> function UniMainModule: TUniMainModule;

> begin

> if UniApplication <> nil then

> Result := TUniMainModule(UniApplication.UniMainModule)

> else

> Result := TUniMainModule(VCLMainModule);

> end;

>

 

Hi Junior,

 

Where did you find this code? It must be from an old Sample code.

 

New format is :

 

function UniMainModule: TUniMainModule;

begin

Result := TUniMainModule(UniApplication.UniMainModule)

end;

 

It is necessary when you want to access UniMainModule from other units.

 

 

.

 

Link to comment
Share on other sites

Message from: "Junior/RO"

 

Farshad Mohajeri escreveu:

 

> Where did you find this code? It must be from an old Sample code.

 

See the thread "Sampes user AREA" from 11 of october of 2010. There are a code there.

 

--

Que é essa vida se, com tanto a fazer, não temos tempo para parar e ver?

.

 

Link to comment
Share on other sites

Message from: "Junior/RO"

 

Farshad Mohajeri escreveu:

 

> Where did you find this code? It must be from an old Sample code.

 

The MegaDemo's MainModule.pas use this code too.

 

--

Que é essa vida se, com tanto a fazer, não temos tempo para parar e ver?

.

 

Link to comment
Share on other sites

Message from: "Farshad Mohajeri"

 

"Junior/RO" wrote in message

news:ro0sVShnLHA.2316@anaxagvs227...

> Farshad Mohajeri escreveu:

>

>> Where did you find this code? It must be from an old Sample code.

>

> The MegaDemo's MainModule.pas use this code too.

 

Yes, that demo is an early demo.

 

 

.

 

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...