This topic has been archived. It cannot be replied.
-
工作学习 / IT技术讨论 / 初学COM,请高手指教,也欢迎初学者讨论。题目是:“如何在多个COM OBJECT之间共享数据?”
-deepyellow(DeepYellow);
2001-5-8
(#64103@0)
-
用Singleton and single-threaded model.
-guest:哆嗦;
2001-5-9
(#64999@0)
-
果然是高手,两句话我就~!·#¥%。:-)。Singleton是否指Singleton的COM?COM中好象不能用STATIC VARIABLE吧?如果这样,怎样保持数据?能否解释一下SINGLE-THREADED MODEL?谢谢!
-deepyellow(DeepYellow);
2001-5-10
(#66239@0)
-
你这么说我越发哆嗦了. 从前做过一个项目有类似的问题, 附上当时的技术纪录, 只供参考, 再多咱也不会了. 另外static可以用.
-guest:哆嗦;
2001-5-10
{2631}
(#66357@0)
-
谢谢指教。太深了,留此存档,以后慢慢体会。STATIC member VARIABLE 在COM中可以用吗?为什么在VC中用了STATIC MEMBER VARIABLE 后出现“error LNK2001: unresolved external symbol "private: static long CJobID::m_nID" (?m_nID@CJobID@@0JA)”?
-deepyellow(DeepYellow);
2001-5-11
(#67302@0)
-
没有用过static member variable in class, 在class外用static定义好象可以. 太复杂的东东我也搞不懂, 好象是VC compiler会产生个内部variable name or function name for class members.
-guest:哆嗦;
2001-5-11
(#67314@0)
-
You only declared the static member, you need to define it (initialize ) somewhere in the .cpp file. strictly speaking, C++ forbids initializing static member variable in the class declaration(.h file), unless it is a constant integer type.
-numnum(numnum);
2001-5-11
(#67344@0)
-
有道理。不好意思,看来还是基本功不过关。初了参数传递外,有没有简便的机制实现COM内外的数据传递?
-deepyellow(DeepYellow);
2001-5-13
(#69465@0)