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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...