使用 C++ 填充树视图内容
我需要通过后端程序(C++)以 vb 形式填充树视图。有人可以为我提供一些指导或示例吗?谢谢。
I need to populate a treeview in my vb form through my backend program (C++). Can someone provide me some guidance or examples to do it? Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您需要创建一个简单的基于文本的“协议”,其中您的 C++ 后端可以提供 vb 程序执行树视图控件填充所需的数据。因为它是一个树视图,所以您正在查看分层协议,例如:
其中
attrib
是用于控制树视图的每个叶子中“存储”哪些信息的东西。您可能还需要某种方式让前端“控制”后端,其中上述响应是命令的结果。您需要使用某种形式的进程间通信(IPC)机制来将信息从后端获取到前端。对于 Windows(我假设您使用的是 Windows?),您可以使用命名管道来执行通信。
You need to create a simple text-based 'protocol' where your c++ backend can provide the data needed by the vb program to perform the population of the treeview control. As it's a treeview you are looking at a hierarchical protocol, something like:
Where
attrib
is something used to control what information is 'stored' in each leaf of the treeview. You might also want some way for the frontend to 'control' the backend, where the above response is the result of the command.You need to use some form of interprocess communication (IPC) mechanism to get the information from the backend to the frontend. For Windows (I'm assuming you're using Windows?) you can use Named Pipes to perform the communication.