🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: cn.comp.lang.vc
1 messages
1 total messages Started by zhiguo.zhao Sun, 20 Mar 2005 07:24
DLLģ������ģ��Ķ��ڴ�����
#30
Author: zhiguo.zhao
Date: Sun, 20 Mar 2005 07:24
29 lines
1986 bytes
������һ������
class A;

class B{
public:
  typedef std::vector<c> cvector;
  cvector _cvector;
public:

B(){};
~B(){};
}
DLL�е�һ������ proc������
bool proc(B& b)
{
   A a;
   b._cvector.push_back(a);
}

��exe����LoadLibrary GetProcAddress��ȡproc
B b;
proc(b)
����b������ʱ�����ָ�����⣬_CrtIsValidHeapPointer�����׳��쳣
If a dynamic-linked library (DLL) contains a static link to the run-time
library, then it has its own instance of the run-time heap, and therefore
its own heap, independent of the application's local heap.
����Ļ�DLL����һ�������Ķѣ���Ӧ�ó���ĶѶ�����������proc������Ĵ����ı�push_back��vector��A���󸱱���DLL���У���B��������ʱ�򣬻��ͷ�DLL���е��ڴ棬���Ե��´��󣿣���

��λ��Ϻ�м�ʵ�õĽ���취�����֪��
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads