ListView的派生类 [英] A derived class from ListView
本文介绍了ListView的派生类的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试创建一个自定义ListView类来解决闪烁和自定义绘制内容。
是否可以从ListView基类派生一个新类?类向导似乎反对:该类不能从托管类派生。这在C#中是明智的。
IDE是VS 2012 Express,C ++
I'm attempting to create a custom ListView class to resolve flicker and custom draw stuff.
Is it possible to derive a new class from ListView base class? The class wizard seems to object: "The class cannot be derived from a managed class.". This was a no-brainer in C#.
The IDE is VS 2012 Express, C++
推荐答案
非常糟糕的问题 - 请看我对它的评论。
但是,在你澄清它之前:我怀疑你是试图从这个.NET FCL派生非托管类类。您应该使用托管ref类作为派生类。您可能对使用C ++ / CLI编写混合模式(托管+非托管)代码的可能性感到困惑。在学习如何混合之前,先编写托管代码。
我希望它会立即解决您的问题。如果没有,请不要怪我,而是准确地提出你的问题。
-SA
Pretty bad question — please see my comment to it.
However, before you clarify it: I suspect you are trying to derive non-managed class from this .NET FCL class. You should use a managed "ref" class as a derived class. You probably was confused by the possibility to write "mixed-mode" (managed + unmanaged) code with C++/CLI. Write just managed code, before you learn how to mix.
I hope it will immediately resolve your problem. If not, please don't blame me, pose your question accurately instead.
—SA
这篇关于ListView的派生类的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文