Hi All,<div><br></div><div>It seems that I was missing the type in the call to a generic method, </div><div><br></div><div>myClassInstance.MyMethod[type]() </div><div><br></div><div>seem to work. Sorry for my impatience.<br>
<br><div class="gmail_quote">2011/1/25 Oleksii Bidiuk <span dir="ltr"><<a href="mailto:oleksii.bidiuk@gmail.com">oleksii.bidiuk@gmail.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Hi All,<div><br></div><div>does anybody have experience with getting the InvalidOperationException exception when calling a generic method defined like</div><div><br></div><div><div>generic <typename T></div><div>MyClass::AnotherClass<T>^ MyClass::MyMethod()</div>
<div>{</div></div><div>...</div><div>}</div><div><br></div><div>When I create an instance of the MyClass and call the MyMethod() the exception mentioned above is thrown with the following stack trace:</div><div><br></div>
<div><div>System.InvalidOperationException: Late bound operations cannot be performed on types or methods for which ContainsGenericParameters is true.</div><div> at System.Reflection.RuntimeMethodInfo.ThrowNoInvokeException()</div>
<div> at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invoke</div><div>Attr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)</div><div> at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invoke</div>
<div>Attr, Binder binder, Object[] parameters, CultureInfo culture)</div><div> at Python.Runtime.MethodBinder.Invoke(IntPtr inst, IntPtr args, IntPtr kw, MethodBase info, MethodInfo[] methodinfo) in C:\...\pythonnet\src\runtime\methodbinder.cs:line 356</div>
</div><div><br></div><div>The MyClass is an external library which I cannot influence. Calling the MyMethod is the only way to get data access, so I cannot simply 'avoid using it'. Perhaps some additional wrapping is needed here? Ideas are highly appreciated!</div>
<div><br>-- <br>oleksii<br>
</div>
</blockquote></div><br><br clear="all"><br>-- <br>oleksii<br>
</div>