🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Assembly

#469
From: Stefanidis Dimitris
Date: Tue, 12 Oct 2004 08:29
75 lines
2705 bytes
By using static i have 2 problems
Problem 1)
   a := Assembly.LoadFrom('Package2.dll');
   typ := a.GetType('WinForm2.TWinForm2');
   meth := typ.GetMethod('Foo_Ex');

Case 1 :
       o := Activator.CreateInstance(typ);
      Result := meth.Invoke(o,['distef']).ToString;
Exception ::Object reference not set to an instance of an object

Case2
      Result := meth.Invoke(nil,['distef']).ToString;

Exception ::Object reference not set to an instance of an object


On Static class function :
  With TWinForm2.Create do
   begin
     Show;
     TextBox1.Text := aVariable;
   end;



Problem 2)
  With TWinForm2.Create do <<--- This is very big problem (can't use self)
Beacause let's say
i have an Twinform3 = class(TWinForm2)
This mins by calling TWinForm3.Foo_Ex i'm allways getting TwinForm2 insteed 
of TWinForm3
Or i have to override this class function and re emplement on every child 
class.

Is this nay other way to do all this functionality ????

Example please !!!!!!




Thanks
Dimitris












"Marc Rohloff [TeamB]" <"on request"> wrote in message 
news:193806g05jowf$.dlg@marcrohloff.40tude.net...
> On Mon, 11 Oct 2004 18:48:36 +0300, Stefanidis Dimitris wrote:
>
>> In TWinForm2
>> public
>> class function Foo_Ex(aString:String):String;
>
> Delphi class functions aren't 100% compatible with .NET 'static'
> functions.
>
> If you want a /NET compatible static function define it as"
> class function Foo_Ex(aString:String):String; static;
>
> Although now you can't use self inside of foo_ex.
>
> -- 
> Marc Rohloff [TeamB]
> marc rohloff at myrealbox dot com 
Technical Details
Message-ID: <416b95b1$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!prodigy.com!atl-c02.usenetserver.com!news.usenetserver.com!peer01.cox.net!cox.net!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail
References: <416a6b58@newsgroups.borland.com> <160pc6hq54s6u.dlg@marcrohloff.40tude.net> <416aab1c$1@newsgroups.borland.com> <193806g05jowf$.dlg@marcrohloff.40tude.net>

Show Full Headers
Complete Article Headers
X-Google-Thread: 1eff29,f1ab105b74fcb56e
X-Google-Attributes: gid1eff29,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Stefanidis Dimitris" <distef01@yahoo.gr>
Newsgroups: borland.public.delphi.winforms.controls.using
References: <416a6b58@newsgroups.borland.com> <160pc6hq54s6u.dlg@marcrohloff.40tude.net> <416aab1c$1@newsgroups.borland.com> <193806g05jowf$.dlg@marcrohloff.40tude.net>
Subject: Re: Assembly
Date: Tue, 12 Oct 2004 11:29:29 +0300
Lines: 77
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
X-RFC2646: Format=Flowed; Original
NNTP-Posting-Host: 194.30.233.129
Message-ID: <416b95b1$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1097569713 194.30.233.129 (12 Oct 2004 01:28:33 -0700)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!prodigy.com!atl-c02.usenetserver.com!news.usenetserver.com!peer01.cox.net!cox.net!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail