ATL dll可以将类对象作为参数吗? [英] can ATL dll take a class object as parameter?

查看:87
本文介绍了ATL dll可以将类对象作为参数吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我有一个ATL dll项目和其中的两个类(classA,classB). ClassA将classB作为参数.


i have an ATL dll project and two classes (classA,classB) in it. ClassA takes the classB as parameter. In ATL is it possible and how?

推荐答案

为什么应该不可能? :)

Why should it be impossible ? :)

class B;

class A
{
...
public:
  A(B* pB);
...



-
当您必须通过接口传输类实例时-
您可以定义类似TakeData(IStream* pStream)的函数:)

调用者可以创建与COleStreamFile
相关联的IStream 将任何对象序列化到文件中
并将分离的IStream*传递给接口函数:)

当然,服务器必须知道所运输的对象
及其序列化方法...:)



--
When you will have to transport class instances by an interface -
you could define a function like TakeData(IStream* pStream) :)

The caller could create an IStream associated with COleStreamFile,
serialize any object(s, collections) in to the file
and pass the detached IStream* to the interface function :)

Of course the server must know the trasported objects
and their serializing methods... :)


感谢您的回答Eugen
Thank you for your answer Eugen


这篇关于ATL dll可以将类对象作为参数吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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