DLL中的私有结构 [英] Private struct in a DLL

查看:124
本文介绍了DLL中的私有结构的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

好吧,我想做的是在DLL中有一个电话"结构,在该结构中可以访问电话列表而不是其自身结构.基本上,我在课堂上有一些人口统计数据,并且在其中可以有多个数字/类型/状态,因此可以提供电话数据列表.除非我公开不想公开的内容,否则我会不断获得不一致的可访问性.
---加法---
请参阅下面的进一步说明.但是是简短版本,试图找出访问/更新DLL中信息的最佳实践,同时对调用应用程序可用的内容保持一定级别的控制.

Ok, what I want to do is have a "telephone" struct in a DLL where the list of telephone is accessible not the struct its self. Basically I have some demographic data in the class and within there can be multiple numbers/types/statuses thus the list of telephone data. I keep getting Inconsistent accessibility unless I make it public which I don''t want to do.
--- Addition ---
Please see below for further clarification. However short version, trying to figure out the best practice for accessing/updating the information in the DLL while maintaining a certain level of control over what is available to the calling application.

推荐答案

1.首先,您应该有一个名为Telephone class 而不是一个struct ,并且此类应实现一个名为TelephoneInfointerface let.
2.在TelephoneInfo 界面(必须是公共的)中,您必须添加要从外部访问的所有属性和方法.
3.您的Telephone 列表应更改为TelephoneInfo的列表.
1.First you should have a class named Telephone and not a struct and this class should implement an interface let named TelephoneInfo.
2.In the TelephoneInfo interface (that must be public) you have to add all properties and methods that you want to be accessible from the outside world.
3.Your list of Telephone should be changed to list of TelephoneInfo.


这篇关于DLL中的私有结构的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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