public SimpleCData from_address(CodeContext /*!*/ context, IntPtr ptr) { SimpleCData res = (SimpleCData)CreateInstance(context); res.SetAddress(ptr); return(res); }
public SimpleCData in_dll(CodeContext /*!*/ context, object library, string name) { IntPtr handle = GetHandleFromObject(library, "in_dll expected object with _handle attribute"); IntPtr addr = NativeFunctions.LoadFunction(handle, name); if (addr == IntPtr.Zero) { throw PythonOps.ValueError("{0} not found when attempting to load {1} from dll", name, Name); } SimpleCData res = (SimpleCData)CreateInstance(context); res.SetAddress(addr); return(res); }