C# 反射调用dll函数,再怎么获取内存数据?
Assembly asm = Assembly.LoadFile(@"D:\vsproject\CadBatch\CadBatch\libry\acdbmgd.dll");Type t1 = asm.GetType("AcDbPlotSettings");
object oPubClass = Activator.CreateInstance(t1, new object[] { theLayout.ModelType });
MethodInfo oMethod = t1.GetMethod("getPlotPaperSize", BindingFlags.Instance | BindingFlags.NonPublic);
Point2d pntop = default(Point2d);
object result = oMethod.Invoke(oPubClass, new Object[] {&pntop.X, & pntop.Y });
Type object21 = result.GetType();
Object object22 = Marshal.PtrToStructure(plotSet.UnmanagedObject, asm.GetType("AcDbPlotSettings")); 要继续反射调用AcDbPlotSettings吧 Light紫星 发表于 2022-6-16 11:31
要继续反射调用AcDbPlotSettings吧
AcDbPlotSettings 是个internal内部类,反射返回值是指针类型,怎么把object 转换为指针。
页:
[1]