'vmethodptr'在当前上下文中不存在

时间:2018-10-11 12:15:11

标签: c# pointers methods virtual

反编译后,在Visual Studio中出现以下错误,我不明白为什么。

  

错误CS0103
  名称'__vmethodptr'在当前上下文中不存在RollCallConsole02 D:\ VS Projects \ RollCallConsole02 \ RunRollCall.cs 194有效

它来自代码的这一部分,该部分将数据导出到报告文件,以便可以打印。

Here you can find a screenshot of Visual Studio

和下面是代码的文本版本。
任何帮助将不胜感激,如果您有任何疑问,请随时提出。

public void Export(LocalReport report)
{
  string str1 = "<DeviceInfo><OutputFormat>EMF</OutputFormat><PageWidth>8.27in</PageWidth><PageHeight>11.7in</PageHeight><MarginTop>0.15in</MarginTop><MarginLeft>0.35in</MarginLeft><MarginRight>0.15in</MarginRight><MarginBottom>0.15in</MarginBottom></DeviceInfo>";
  if (RunRollCall.LandscapeLayout == 1)
    str1 = "<DeviceInfo><OutputFormat>EMF</OutputFormat><PageWidth>11.7in</PageWidth><PageHeight>8.27in</PageHeight><MarginTop>0.15in</MarginTop><MarginLeft>0.35in</MarginLeft><MarginRight>0.15in</MarginRight><MarginBottom>0.15in</MarginBottom></DeviceInfo>";
  Warning[] warningArray = (Warning[]) null;
  this.m_streams = (IList<Stream>) new List<Stream>();
  LocalReport localReport = report;
  string str2 = "Image";
  string str3 = str1;
  RunRollCall runRollCall = this;
        // ISSUE: virtual method pointer
        CreateStreamCallback createStreamCallback = null;new CreateStreamCallback((object) runRollCall, __vmethodptr(runRollCall, CreateStream));
  ref Warning[] local = ref warningArray;
  localReport.Render(str2, str3, createStreamCallback, out local);
  IEnumerator<Stream> enumerator = null;
  try
  {
    enumerator = this.m_streams.GetEnumerator();
    while (enumerator.MoveNext())
      enumerator.Current.Position = 0L;
  }
  finally
  {
    enumerator?.Dispose();
  }
}

0 个答案:

没有答案