[英]How can I get a list of all methods in a certain class from c++ in mono?
I've loaded my assembly "monoass.dll" using 我已经加载了我的程序集“monoass.dll”
mono_domain_assembly_open(domain, "C:/monoass.dll");
then I found my class which name is "MainClass" using 然后我发现我的班级名称是“MainClass”使用
mono_class_from_name(mono_assembly_get_image(ass), "monoass", "MainClass"); // where "monoass" is the name of namespace
then I need to find all methods in "MainClass" class as MonoMethod**
array. 那么我需要在“MainClass”类中找到MonoMethod
MonoMethod**
数组中的所有方法 。 How can I do this? 我怎样才能做到这一点?
Mono version is: Mono-3.2.3 单声道版本是:Mono-3.2.3
Additional questions: 其他问题:
1) How can I output the MonoMethod
's name, arguments and return value to the console? 1)如何将
MonoMethod
的名称,参数和返回值输出到控制台? Is there any mono_method_to_string(MonoMethod* method) function? 有没有mono_method_to_string(MonoMethod *方法)函数?
2) How can I get all namespaces in my assembly (and print each name to the console) and then for each namespace get the array of all clases which are in the namespace? 2)如何在程序集中获取所有名称空间(并将每个名称打印到控制台),然后为每个名称空间获取名称空间中所有clases的数组?
you can get all methods like this: 你可以得到这样的所有方法:
void* iter = NULL;
MonoMethod* method;
while(method = mono_class_get_methods(mono_class, &iter))
{
cout << mono_method_full_name(method, 1);
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.