T
Thomas Sondergaard
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:p_Explicit(gchandle).ToInt32();
return Data_Wrap_Struct(klass, 0, DotNetHandle_free, handle);
}
Thomas
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:p_Explicit(gchandle).ToInt32();
return Data_Wrap_Struct(klass, 0, DotNetHandle_free, handle);
}
Thomas