Sean O'Dell
9/27/2003 5:08:00 PM
Thomas Sondergaard wrote:
> Is it okay to wrap something that is not a struct with Data_Wrap_Struct?
> Like this where I just wrap an int?
>
> VALUE DotNetObjectToRubyObject(VALUE klass, System::Object *anObject) {
> GCHandle gchandle = GCHandle::Alloc(anObject);
> int *handle = ALLOC(int);
> *handle = GCHandle::op_Explicit(gchandle).ToInt32();
> return Data_Wrap_Struct(klass, 0, DotNetHandle_free, handle);
> }
Sure, anything will do. =)
Sean O''Dell