[Mono-dev] PInvoke Problem on Ubuntu

barton_c barton at bcdesignswell.com
Sat Mar 19 15:33:02 EDT 2011


This actually seems to be a PythonDotNet question. The PythonDotNet
sourceforge project does have it's own mail list.

The proper python syntax is:
import clr
clr.AddReference('pinvoketest')   # the name of the Mono or .NET assembly
from PinvokeTest import Invoke  #  Mono or .NET namespace maps to a python
module; grab the class from there 

# Now call a method on the class
Invoke.WriteToFile('t') 

Here's my c# test:
using System;
using System.Runtime.InteropServices; 
namespace PinvokeTest
{
	public class Invoke 
	{

            public static void WriteToFile(char arg)
            {
            Console.WriteLine("Writing {0}", arg);
                        return;
		}
	}
}

--
View this message in context: http://mono.1490590.n4.nabble.com/PInvoke-Problem-on-Ubuntu-tp3385915p3390167.html
Sent from the Mono - Dev mailing list archive at Nabble.com.


More information about the Mono-devel-list mailing list