[Python.NET] Custom arguments from python to C#

Kaveripakam, Sathish Sathish.Kaveripakam at phonak.com
Thu Jun 19 15:24:46 CEST 2008


Hi All,
 
I am trying to interface with C# dlls from python. I am using Python.net
2.0 version. Please find the problem description:
 
python:
 
clr.AddReference("X.dll")
 
 import Master.Child as ChildClass
 
ChildClass.Currclass(structVal, enumval)     ---Step 1
 
ChildClass.Currclass(2,3)                           ---Step 2
 
C# code (which gives X.dll)
 
namespace Master.Child
{
  enum enumval
{
-,
--,
--,
}
 
class Currclass{
 
Currclass(Stream X, enumval enum)                      .-.-Constructor 1
{
  Console.WriteLine("Step1");
}
 
Currclass(int x, int y)
.-.-Constructor 2
{
 Console.WriteLine("Step2");}
}}
 
 
When i try to create an instance using the custom types (ie Setp1), the
C# constructor : Constructor2 is executed and while executing the Step2
also the Constructor 2 is called.
 
I am not sure, why Constructor 1 is not called. Is it because it uses
the custom arguments types ?
 
Any inputs to call Constructor1 is welcome.

******************** 
Legal Notice: 
The information in this electronic transmission may contain confidential or
legally privileged information and is intended solely for the individual(s)
named above. If you are not an intended recipient or an authorized agent,
you are hereby notified that reading, distributing, or otherwise
disseminating, copying or taking any action based on the contents of this
transmission is strictly prohibited. Any unauthorized interception of this
transmission is illegal under law. If you have received this transmission in
error, please notify the sender by telephone [at the number indicated above/
on +41 58 928 0101] as soon as possible and then destroy all copies of this
transmission. 
********************
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/pythondotnet/attachments/20080619/0e2520e7/attachment.htm>


More information about the PythonDotNet mailing list