On Jul 22, 2006, at 8:33 AM, Alfred Van Hoek wrote:

Well, one of the other things that I am confused about is declaring the method. Does the name of the method in C have to be the same as the "description" written in the REALmethodDefinition? (all examples I have seen have shown the same name). I tried naming my C methods "Constructor" but I had some sort of compile error.

A REALmethodDefinition maps a C-function to a RB method declaration. So if you define a method map like

{ (REALproc) MyCMethodConstructor, REALnoImplementation, "Constructor(p As Picture)" },

Does each function (such as "MyCMethodConstructor") need to have a unique name?

Then the user can only instantiate your class with: myClass As yourClass = new yourClass(p). By defining a single constructor in the REALmethodDefinition you also automatically disable the default ability to call "new yourClass()".

OK, that might be the reason why I was crashing... I also had a default constructor/initializer defined.

I currently am trying to have three constructors (though I would rather have two with a default value). The problem is that the constructor that I really want to use takes a Picture as a parameter and all attempts to use this constructor have crashed.

Then you do something wrong elsewhere.

Might be the reason above.

It is like an RB experience... And just forget about the "Initializer" and "Finalizer" declarations. Those are never exposed to the user of your plugin. They are only meant if you need to do things under the hood. For example you need to allocate memory, respectively deallocate memory. If it is a simple struct you are dealing with, then the initializer and/or finalizer can be nil.

Well I am allocating/deallocating memory, but I also use the "Initializer" to set all of the struct values to their default values.


_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to