tags:

views:

25

answers:

0

I have a C++ library which provides the following enum and function:

typedef enum en{
  a,
  b
}myEnum;

int myFunction( myEnum &varToSet )
{
  varToSet = 1;
  return 0;
}

The function in the C# Wrapper should look something like this:

public static int myFunction( ref myEnum varToSet )

I have tried to get this result by following typemap in the Swig interface file:

%typemap(cstype) myEnum & "ref myEnum"
%typemap(csin) myEnum & %{ref $csinput%}  

Swig changed the type from SWIGTYPE_p_myEnum to ref myEnum in Wrapper.cs, but not in WrapperPINVOKE.cs. What am I missing here?