Hi Shankari,

[...] In fact I dont bother about how my C function
prototype looks like as it can choose not to use any
arguments passed to it.

It won't work on Win32, unless you switch to cdecl prototypes.

My C# function does a Dll import like [DllImport(...)]
static extern void func (param1, param2);

Under  normal cases, I would call func(param1,param2)
from C#.

But I want to set a flag during this. So, I thought of
doing it like this.

The C function implementation remains as it is. But
Dll import is changed to
[DllImport(...)]
static extern void func (flag, param1, param2);

C# invocation : func(flag,param1,param2)

Why so complicated?

Define the C DllImport to match its real parameter list:

[DllImport(...)]
static extern void func (param1, param2);

Then define a C# method that takes your additional flag:

public static void func (flag,param1,param2)
{
  // do something with "flag"
  ...
  // call the dll import
  func (param1, param2);
}

Rob

_______________________________________________
Mono-list maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-list

Reply via email to