[Python.NET] Problem to use a dll: System.ApplicationException: Error 1: OpenDevice: Invalid handle

2013-01-15 Thread Daniel Krause
I am trying to use a dll to control a camera. It is possible for me to use the dll with ironpython, but I fail to use it with python for .NET (CLR 4.0). (And I would like to use e.g. numpy as well, so I need python for .NET). Below follow a short test script, the python / ironpython versions and t

Re: [Python.NET] Problem to use a dll: System.ApplicationException: Error 1: OpenDevice: Invalid handle

2013-01-16 Thread Daniel Krause
ssembly that opens a > command prompt so that you can inspect the environment variables. For me, > this is almost always a system path / current directory issue. Hopefully > I’m not leading you down a false road. > > ** ** > > *From:* m.daniel.kra...@googlemail.com [mailto: >

Re: [Python.NET] Problem to use a dll: System.ApplicationException: Error 1: OpenDevice: Invalid handle

2013-01-17 Thread Daniel Krause
gt; > Sent from my iPad > > On Jan 16, 2013, at 3:49 PM, Daniel Krause wrote: > > Hi Brett, > > to check your suggestion I added a print statement to the script (after > clr.AddReference("xiAPI40.NET"): > > print sys.path > > The result looks ok to me: &

[Python.NET] Problem to use a dll: System.ApplicationException: Error 1: OpenDevice: Invalid handle

2013-01-19 Thread Daniel Krause
I am trying to use a dll to control a camera. It is possible to use the dll with ironpython, but I fail to use it with python for .NET (CLR 4.0). (And I would like to use numpy as well, so I need python for .NET). Below follow a short test script, the python / ironpython versions and their console

[Python.NET] How to use BitmapSource from System.Windows.Media.Imaging ?

2013-01-21 Thread Daniel Krause
I want to use BitmapSource from System.Windows.Media.Imaging (Documentation here: http://msdn.microsoft.com/de-de/library/system.windows.media.imaging.bitmapsource(v=vs.100).aspx) It would be great if someone could help me with this, as I do not have yet much experience with python for .NET, and n

Re: [Python.NET] How to use BitmapSource from System.Windows.Media.Imaging ?

2013-01-21 Thread Daniel Krause
43-c1ae-41cd-bbeb-8ff6c1c879ec > I believe this will help you. > > HTH > > Thanks and best regards, > > Jojo Maquiling > > On Mon, Jan 21, 2013 at 3:40 AM, Daniel Krause > wrote: > > I want to use BitmapSource from System.Windows.Media.Imaging > > (Document

Re: [Python.NET] How to use BitmapSource from System.Windows.Media.Imaging ?

2013-01-22 Thread Daniel Krause
on. > > Distributing a python script with .net dependencies can get rather ugly. > > -brad > > On Jan 21, 2013, at 2:10 PM, Daniel Krause > wrote: > > Hi Jojo, > > thanks for your help. > > The following code is running (64bit-Windows): > > import c

[Python.NET] Problem with System.ArgumentException in call to method from dll

2013-01-22 Thread Daniel Krause
I want to use a method from an API to control a camera (xiApi.NETX64.dll). The method is described in two ways: // void GetImage( out WriteableBitmap image, int timeout) Description : This function acquires image and returns fills WritableBitmap object. Supports UNSAFE buffer policy mode. Paramete

Re: [Python.NET] Problem with System.ArgumentException in call to method from dll

2013-01-22 Thread Daniel Krause
not speak german. But I think that's it. > > On Jan 22, 2013, at 2:58 PM, Daniel Krause > wrote: > > > I want to use a method from an API to control a camera > (xiApi.NETX64.dll). > > > > The method is described in two ways: > > // > > void GetIma

Re: [Python.NET] Problem with System.ArgumentException in call to method from dll

2013-01-23 Thread Daniel Krause
...@fie.us > Just to clarify: neither version of the methods you are calling are marked > "unsafe" in the proper c# .net manner are they? I would not be surprised > to find PythonNet not providing access to "unsafe" methods. I would need > to take a trip through the so

Re: [Python.NET] Problem with System.ArgumentException in call to method from dll

2013-01-23 Thread Daniel Krause
rtAcquisition() > timeout = 1000 > bitmapsrc = cam.GetImage(bitmapsrc, timeout) > cam.StopAcquisition() > ## > > Console output: > > > What you need is an instance, perhaps: > bitmapsrc = BitmapSource() # or something to that effect. > > > On 01/22/2013 11:58 AM

Re: [Python.NET] Problem with System.ArgumentException in call to method from dll

2013-01-23 Thread Daniel Krause
the camera code in a very thin > assembly that manages this stuff and provides a clean interface for > python.net to hook into. I’m lazy that way though… > > ** ** > > *From:* PythonDotNet [mailto:pythondotnet-bounces+btribble= > ea@python.org] *On Behalf Of *Daniel

[Python.NET] How to pass a Type to a method?

2013-01-24 Thread Daniel Krause
I would like to use System.Array. The following code is running with iron python import clr import System from System import Array from System import Int32 from clr import GetClrType rows = 1 columns = 2 #method: Array.CreateInstance(Type, Int32, Int32) array = Array.CreateInstance(GetClrType(Int

Re: [Python.NET] How to pass a Type to a method?

2013-01-24 Thread Daniel Krause
m/codes/search/clr > > ** ** > > Can you use the following instead? > > ** ** > > import System > > … > > ** ** > > … > > array = Array.CreateInstance(System.Int32, rows, columns) > > ** ** > > *From:* PythonDotNet [mailto:pythondotn

Re: [Python.NET] debugging

2013-07-23 Thread Daniel Krause
This link might help you: http://www.lfd.uci.edu/~gohlke/pythonlibs/ 2013/7/23 Jason Sachs > is there a prebuilt version of pythonnet for x64? I tried downloading > source + opening the VS10 solution file it in Visual Studio express 2013 > but it gives a bunch of migration errors. > > > On Mon,

[Python.NET] How to provide a variable of special type as method parameter

2018-05-14 Thread Daniel Krause
Hi, I posted this question at stackoverflow some days ago: https://stackoverflow.com/questions/50254745/how-to-provide-a-variable-of-special-type-as-method-parameter I want to use a DLL with the help of Python for .NET (pythonnet). The methods in this DLL require (pointer to?) variables as parame