On 27/10/2013 at 03:33, xxxxxxxx wrote:
User Information:
Cinema 4D Version: R14
Platform: Windows ;
Language(s) : C++ ;
---------
Hi Folks,
I'm a little lost with the following scenario. I've got an array of a custom class, and I'm wishing to make a pointer to it. What I've done is the following:
CUSTOMCLASS *MyCLass;
With this pointer, I'm getting an address to an object of the class (is that correct?) in a vector of vectors by:
MyClass = &MyVector;[1][2];
The above compiles, but I feel a little uneasy with it. Is this correct thus far, or do I need to be using gNew somewhere here?
The next little hold-up is that the custom class can take an argument. To give this some sense, here's an example of what I can do when a pointer is not used:
CUSTOMCLASS MyCClass;
Real bleh = MyCClass(Real);
So my queries with the above, if anyone can follow it (!!), is do I need to use gNew on the pointer to begin with? Or can I go straight to the address of the class object in the vector?
Secondly, I'm unable to compile the plugin when I try adding an argument to a pointer like I do to the direct class object above, that is:
CUSTOMCLASS *MyClass;
Real bleh = MyClass(Real); // doesn't compile
I've done plenty of general pointer searches but not really quite finding something I can relate too when arrays are involved, or when the class can take an argument.
Could someone give some pointers for the above (pun intended!), or provide some search terms I can go look up that might help a bit in solving the above?
Hope I've covered my query with some sense! Cheers,
WP.