🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.delphi.winforms.controls.using
Article #482

Re: Assembly Part 2 :)

#482
From: Marc Rohloff TeamB
Date: Fri, 15 Oct 2004 23:44
55 lines
2996 bytes
On Fri, 15 Oct 2004 10:49:18 +0300, Stefanidis Dimitris wrote:

> Class procedure Foo_ex(var aVariable:String);
...
>   s := meth.Invoke(nil, [cl, s]) as string;
This is not a function so it won't return a value.
If you wan to access var parameters you have to do something like:

 var
   ...
   params: array of TObject;
 begin
  ...
  SetLength(Params, 2);
  Params[0] := cl;
  Params[1] := 'Question';
  meth.Invoke(nil, params);
  s := Params[1] as string;

> Version 2 WinForm Object
> Class procedure Foo_ex(var aVariable:TEditBox);
TEditBox is not a Winforms component. Also why are you passing it as
var if you are not changing the reference?

> Version 2
>   s := meth.Invoke(nil, [cl, TextBox1]) as string;  <----- Exception Null 
> Refernce (aVarable in Foo_Ex is nil)
Again you return no value. Even if you did conaider the 'var'
parameter a return value it is the wrong type.

> Version 3 Vcl Objects :)
> Class procedure Foo_ex(var aVariable:TSqlConnection);
Again why are you passing this as 'var'?



> I think we cover all possiblities :) (except in assembly there is vcl form 
> insteed of FCL :) )
> Let me explain what i;m trying to do :
> I want my main application parted to dll's (assemlys);
> I want my application does not know anything about the containing of dll's 
> (not refernce) and load all dll's dynamicly when requested just by knowing 
> in string Class name, Name and dll name.
> I 'm gonna have an dll wich has all abstract objects and other dll's with 
> child classes
> In db all menu items and related dlls and classes with each menu item.
> Ufff . That's all :) What are you thing ??? is it possible ?????

Yes, this is a common way to do it. Another way might be to call a
single function each assembly and ask it to register all its menu
items etc.

-- 
Marc Rohloff [TeamB]
marc rohloff at myrealbox dot com
Technical Details
Message-ID: <103z8zsknkgs2$.dlg@marcrohloff.40tude.net>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!sn-xit-04!sn-xit-12!sn-xit-09!sn-xit-13!supernews.com!216.170.153.135.MISMATCH!tdsnet-transit!newspeer.tds.net!newspeer.radix.net!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!logbridge.uoregon.edu!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail
References: <416eb016$1@newsgroups.borland.com> <1xsxwwlxfiy0n.dlg@marcrohloff.40tude.net> <416f80c2$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 1eff29,2ac59de14c919c27
X-Google-Attributes: gid1eff29,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Marc Rohloff [TeamB]" <"on request">
Subject: Re: Assembly Part 2 :)
Newsgroups: borland.public.delphi.winforms.controls.using
User-Agent: 40tude_Dialog/2.0.14.1
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
References: <416eb016$1@newsgroups.borland.com> <1xsxwwlxfiy0n.dlg@marcrohloff.40tude.net> <416f80c2$1@newsgroups.borland.com>
Date: Fri, 15 Oct 2004 19:44:53 -0400
Message-ID: <103z8zsknkgs2$.dlg@marcrohloff.40tude.net>
NNTP-Posting-Host: 4.131.33.12
X-Trace: newsgroups.borland.com 1097883760 4.131.33.12 (15 Oct 2004 16:42:40 -0700)
Lines: 55
X-Authenticated-User: mrohloff
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!sn-xit-04!sn-xit-12!sn-xit-09!sn-xit-13!supernews.com!216.170.153.135.MISMATCH!tdsnet-transit!newspeer.tds.net!newspeer.radix.net!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!logbridge.uoregon.edu!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail