[Kde-bindings] playground/bindings/kimono

Arno Rehn arno at arnorehn.de
Wed Dec 7 18:40:39 UTC 2005


Am Mittwoch, 7. Dezember 2005 19:52 schrieb Richard Dale:
> On Wednesday 07 December 2005 17:47, Arno Rehn wrote:
> > > Is there a way of invoking some code on loading a package in C#? So we
> > > could call Qyoto_Init() automatically.
> >
> > I don't think there's such a way, but we could call the method everytime
> > a QApplication is constructed. Without this class being constructed no
> > function in Qt will succeed, except things like QMessageBox. And if
> > someone only wants a QMessageBox, he can simply call 'Qyoto_init()'.
>
> Yes, that's what I'd thought of doing - I'll add that call to the
> QApplication constructor.
>
> Another issue is adding the name of the executable to the argv string[]
> array passed to the QApplication constructor. I've been searching today for
> some info on how to get the program name, but haven't found anything. All
> my books about C# are back in the UK, so I can't look it up. If you can
> find anything about it, or maybe getting the name of the class with Main()
> in it if the executable name isn't available.

Right now I'm googling about the attributes to methods. It's quite easy to 
code your own Attribute, but I don't know how to get the Attributes at 
Runtime. If you use MethodInfo.Attributes you only get things like 'static', 
'public' etc.
I don't have much time at the moment (school's really getting on my nerves 
right now :( ), but you could take a look at the static Methods of 
System.Reflection.Assembly. Maybe GetExecutingAssembly() helps.

-- 
MfG
Arno Rehn
arno at arnorehn.de



More information about the Kde-bindings mailing list