Hello,

I am trying to use the 'as' operator to access interface methods. I am
using reflection to create an instance of the class which implements the
interface. I am able to obtain the object but the 'as' operator always
returns null for me even though the class does implement the interface. 
I am not sure what is going.  Any help would be greatly appreciated.

code snippet:

System.Object obj = Activator.CreateInstance(type);
IServices current = obj as IServices;

if (current == null)
        Console.WriteLine("obj does not implement IServices");



Thanks,

Joe

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

Reply via email to