CObList ::序列化(AR) [英] CObList::Serialize(ar)

查看:109
本文介绍了CObList ::序列化(AR)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在CObList :: Serialize(ar)

I am getting an error in CObList::Serialize(ar)

中收到错误来自文件  LIST_O.CPP 我使用VS 2015

from file LIST_O.CPP  i asm using VS 2015

void
CObList :: Serialize( CArchive &
ar

{

      
ASSERT_VALID this );

      
CObject :: Serialize( ar );

      
if ar 。IsStoring())

        {

         ;    
ar 。WriteCount(m_nCount);

    ;         
for CNode *
pNode = m_pNodeHead; pNode!=
NULL ; pNode = pNode-> pNext)

             {

         ;           
ASSERT (AfxIsValidAddress(pNode,
sizeof CNode )));

                   
ar
<< pNode-> data;

&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP; }

       }

      
else

       {

         ;&NBSP;&NBSP;&NBSP;&NBSP;
DWORD_PTR nNewCount =
ar 。ReadCount();

&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;
CObject * newData;

             CObject* newData;

&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;
while (nNewCount - )

    &NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP; {

         ;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;
ar
>> newData;

                    ar >>newData;

                &NBSP;&NBSP;&NBSP;&NBSP; AddTail(newData);

       ;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP; }

       }

}

当我使用  多线程调试DLL(/ MDd) 
其维持罚款。

如果我使用  多线程DLL(/ MD)  , 

if i use Multi-threaded DLL (/MD)  , 

CObject * newData; 无法为对象创建内存。和  ar   >>   newData;    i
例外。请在这个i结构中帮助。

CObject* newData; not able to create memory for object. and at ar >> newData;  i am getting exeption . plz help in this i struct here.

推荐答案

Hi Bolleni,

Hi Bolleni,

感谢您在此处发帖。

>> CObject * newData;无法为对象创建内存。并在ar>> newData;&NBSP;我得到了解释。在这个i结构中帮助plz。

首先,你需要注意传递给链接器的给定调用的所有模块必须使用相同的运行进行编译-time库编译器选项(/ MD,/ MT,/ LD)。

First of all, you need to notice that all modules passed to a given invocation of the linker must have been compiled with the same run-time library compiler option (/MD, /MT, /LD).

使用/ MD选项编译的应用程序静态链接到MSVCRT.LIB。该库提供了一层代码,允许链接器解析外部引用。实际工作代码包含在MSVCRT.DLL中,该代码必须在运行时
提供给与MSVCRT.LIB 链接的应用程序

Applications compiled with /MD option are statically linked to MSVCRT.LIB. This library provides a layer of code that allows the linker to resolve external references. The actual working code is contained in MSVCRT.DLL, which must be available at run time to applications linked with MSVCRT.LIB.

希望这个可以帮到你。

最好的问候,

Baron Bi


这篇关于CObList ::序列化(AR)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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