如何在dll中实例化通常需要parent(TWinControl)的类? [英] How to instantiate a class which normally needs parent(TWinControl) in a dll?

查看:46
本文介绍了如何在dll中实例化通常需要parent(TWinControl)的类?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我必须动态地使用通常具有可视部分的组件.该可视部分可以关闭,但是当我创建组件时,它需要父级.

I have to make use of the component dynamically which normally have the visual part. That visual part can be turned off, but when I create the component it needs parent.

我必须使用dll库中的组件.是否有可能,以及如何解决该问题?我怎样才能通过父母?

I have to use the component in a dll library. Is it possible and how to workaround the problem? How can I pass parent?

谢谢!

推荐答案

创建隐藏的窗口句柄,例如使用 CreateParented 创建控件a>传递该隐藏的窗口句柄.

Create a hidden window handle, for example with AllocateHWnd(nil). And then create your control by calling CreateParented passing that hidden window handle.

这篇关于如何在dll中实例化通常需要parent(TWinControl)的类?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆