Delphi 2010 RTTI - RttiContext.FindType

你。 提交于 2019-11-29 15:36:46
Daniele Teti

Probably the class has not included by the delphi linker in the final executable. A fast try can be the following:

  1. Declare a static method on your class. This method should be an empty method, a simple begin end.
  2. Call this static method in the initialization section of this unit.
  3. Ensure that the unit is referenced in your project somewhere.
  4. Now you should see the class with TRttiContext.FindType.

It could be a handful of things. Hard to say without seeing your code, but here are a few suggestions to look at. Is TMyClass a public type in the interface section? Is RTTI generation turned on for that unit? Is MyUnit in a package that hasn't been loaded yet?

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!