From: Sean O'Dell Date: 2003-09-28T02:08:20+09:00 Subject: Re: Data_Wrap_Struct 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