Esempio n. 1
0
            public SimpleCData from_address(CodeContext /*!*/ context, IntPtr ptr)
            {
                SimpleCData res = (SimpleCData)CreateInstance(context);

                res.SetAddress(ptr);
                return(res);
            }
Esempio n. 2
0
            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);
            }