将数据从dll传递到exe [英] Passing data from dll to exe

查看:99
本文介绍了将数据从dll传递到exe的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我正在尝试编写一个报告应用程序,可以在其中将报告临时添加到该应用程序中.因此,该应用程序由一个Exe组成,该Exe监视用于报告DLL的文件夹.我最想知道的是如何表示数据.我真的不想在每个DLL中都包含一个表示形式,因为它们都非常相似.但是,我认为我不能将DLL中的数据集发送到exe,因为某些报告太复杂了.我还考虑过将表格从EXE传递到要填充的DLL,但随后DLL过度依赖于保持静态的外部表格的设计.

有什么想法可以做到这一点吗?我觉得有一种方法可以创建实际上不与数据库链接的类似于数据集的对象(有点像行的集合或数组,但是内存效率更高).

问候

基思

[添加]

谢谢你们的答复,我对此表示赞赏.我可能是错的,但我认为(可能)在对象数组中发回数千行数据,这可能会给系统带来沉重负担-是正确的,还是只需要花费类似数量的数据?内存作为数据集?

内存中的数据集听起来与我在想的非常相似,但是并不真正知道如何实现,因此非常感谢.
[/添加]

Hi,

I''m trying to write a reporting app where reports can be added to the application on an ad hoc basis. So the application consists of an Exe that monitors a folder for report DLL''s. My quandry is how to represent the data. I don''t really want to include a presentation form in each DLL because they are all very similar. However, I don''t think I can just send a dataset from the DLL to the exe because some of the reports are too complex. I also considered passing a form from the EXE to the DLL to be populated, but then the DLL is overly-dependent on the design of the external form remaining static.

Any ideas how this can be attained? I have the feeling there is some way to create a dataset-like object that isn''t actually linked to a database (kind of like a collection or array of rows, but more memory-efficient).

Regards

Keith

[added]

Thank you both for your responses, I appreciate it. I could be wrong, but I thought sending back (possibly) thousands of rows of data within, say, an array of objects, might be a little heavy on the system - would that be right, or would it only take a similar amount of memory as a dataset?

The In-memory dataset sounds very similar to what I was thinking, but didn''t really know how to implement, so thanks very much.
[/added]

推荐答案

您可以创建自己的类,并使用它们在dll和exe之间共享数据.
You can create your own classes and use them to share the data between the dll and the exe.


您可以创建内存中的数据集,并用表等填充它们.

此处 [ ^ ]是一个示例.
Well you can create in-memory datasets, populate them with tables etc.

Here[^] is an example.


这篇关于将数据从dll传递到exe的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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