Building a C ++ / ATL project correctly: I am trying to use my MFC code in an ATL project (Service EXE). In which I included all my Existing Items. When I set up the project on Use MFC in a Shared DLL, during debugging I had this error message:
error C2039: "CAtlServiceModuleT": is not a member of "ATL".
And the debugger emphasized the highlighted line:
class CATLProject6Module : public ATL::CAtlServiceModuleT< CATLProject6Module, IDS_SERVICENAME >
{
public :
DECLARE_LIBID(LIBID_ATLProject6Lib)
DECLARE_REGISTRY_APPID_RESOURCEID(IDR_ATLPROJECT6, "{3A7F25E3-CA7E-4C90-8B37-11DA70E42248}")
HRESULT InitializeSecurity() throw()
{
return S_OK;
}
};
CATLProject6Module _AtlModule;
How do I fix this?
Here you can find mine stdafx.h:
#if !defined(AFX_STDAFX_H__91E578F6_59F0_4867_BDE7_FCC229588C74__INCLUDED_)
#define AFX_STDAFX_H__91E578F6_59F0_4867_BDE7_FCC229588C74__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif
#define VC_EXTRALEAN
#define _WIN32_WINNT 0x0502
#include <afxwin.h> // MFC core and standard components
#include <afxext.h> // MFC extensions
#include <afxdtctl.h> // MFC support for Internet Explorer 4 Common Controls
#ifndef _AFX_NO_AFXCMN_SUPPORT
#include <afxcmn.h> // MFC support for Windows Common Controls
#endif
#endif
#ifndef STRICT
#define STRICT
#endif
#include "targetver.h"
#define _ATL_FREE_THREADED
#define _ATL_NO_AUTOMATIC_NAMESPACE
#define _ATL_CSTRING_EXPLICIT_CONSTRUCTORS
#define ATL_NO_ASSERT_ON_DESTROY_NONEXISTENT_WINDOW
#include "resource.h"
#include <atlbase.h>
#include <atlcom.h>
#include <atlctl.h>
Thank you so much!
source
share