G
Guest
I have some code that compiles and links fine in VC6 but does not
link in VC7. Here are the relevant parts of the code:
class AView : public CScrollView
{
....
public:
AFX_DISPMAP_ENTRY* _dispatchEntries;
UINT _dispatchEntryCount;
DWORD _dwStockPropMask;
AFX_DATA AFX_DISPMAP dispatchMap;
#ifdef _AFXDLL
static const AFX_DISPMAP* PASCAL _GetBaseDispatchMap();
#endif
virtual const AFX_DISPMAP* GetDispatchMap() const;
}
void AView::MakeMap()
{
#ifdef _AFXDLL
dispatchMap.pfnGetBaseMap = _GetBaseDispatchMap;
#else
dispatchMap.pBaseMap = &CScrollView::dispatchMap;
#endif
_dispatchEntries = new AFX_DISPMAP_ENTRY[nSize];
dispatchMap.lpEntries = _dispatchEntries;
dispatchMap.lpEntryCount = &_dispatchEntryCount;
dispatchMap.lpStockPropMask = &_dwStockPropMask;
_dispatchEntryCount = (UINT) -1;
_dwStockPropMask = (DWORD)-1;
}
#ifdef _AFXDLL
const AFX_DISPMAP* PASCAL AView::_GetBaseDispatchMap()
{ return &CScrollView::dispatchMap; }
const AFX_DISPMAP* AView::GetDispatchMap() const
{ return &dispatchMap; }
#else
const AFX_DISPMAP* AView::GetDispatchMap() const
{ return &dispatchMap; }
#endif
During linking, I get the following error:
error LNK2001: unresolved external symbol "protected: static struct
AFX_DISPMAP const CCmdTarget::dispatchMap"
(?dispatchMap@CCmdTarget@@1UAFX_DISPMAP@@B)
My /LIBPATH includes Vc7/atlmfc/lib which is where I'm
assuming the necessary library resides.
There was a virtually identical problem submitted to
microsoft.public.languages.vc
on July 30, 2002 by sunil, but there was no response.
I would appreciate suggestions how to resolve this.
Tom
link in VC7. Here are the relevant parts of the code:
class AView : public CScrollView
{
....
public:
AFX_DISPMAP_ENTRY* _dispatchEntries;
UINT _dispatchEntryCount;
DWORD _dwStockPropMask;
AFX_DATA AFX_DISPMAP dispatchMap;
#ifdef _AFXDLL
static const AFX_DISPMAP* PASCAL _GetBaseDispatchMap();
#endif
virtual const AFX_DISPMAP* GetDispatchMap() const;
}
void AView::MakeMap()
{
#ifdef _AFXDLL
dispatchMap.pfnGetBaseMap = _GetBaseDispatchMap;
#else
dispatchMap.pBaseMap = &CScrollView::dispatchMap;
#endif
_dispatchEntries = new AFX_DISPMAP_ENTRY[nSize];
dispatchMap.lpEntries = _dispatchEntries;
dispatchMap.lpEntryCount = &_dispatchEntryCount;
dispatchMap.lpStockPropMask = &_dwStockPropMask;
_dispatchEntryCount = (UINT) -1;
_dwStockPropMask = (DWORD)-1;
}
#ifdef _AFXDLL
const AFX_DISPMAP* PASCAL AView::_GetBaseDispatchMap()
{ return &CScrollView::dispatchMap; }
const AFX_DISPMAP* AView::GetDispatchMap() const
{ return &dispatchMap; }
#else
const AFX_DISPMAP* AView::GetDispatchMap() const
{ return &dispatchMap; }
#endif
During linking, I get the following error:
error LNK2001: unresolved external symbol "protected: static struct
AFX_DISPMAP const CCmdTarget::dispatchMap"
(?dispatchMap@CCmdTarget@@1UAFX_DISPMAP@@B)
My /LIBPATH includes Vc7/atlmfc/lib which is where I'm
assuming the necessary library resides.
There was a virtually identical problem submitted to
microsoft.public.languages.vc
on July 30, 2002 by sunil, but there was no response.
I would appreciate suggestions how to resolve this.
Tom