Build Error When Include Web Service in MFC application
-
Hi, I have MFC application and including a web service Then got many error. CCritical setion class is using in MFC project if i remove that class then problem may be solve. But i need that class. I have no idea how to solve this problem????
-
Hi, I have MFC application and including a web service Then got many error. CCritical setion class is using in MFC project if i remove that class then problem may be solve. But i need that class. I have no idea how to solve this problem????
shivanandgupta wrote:
Then got many error
What is the exact error message(s) ? You realize that your question is totally vague ?
Cédric Moonen Software developer
Charting control [v2.0] OpenGL game tutorial in C++ -
Hi, I have MFC application and including a web service Then got many error. CCritical setion class is using in MFC project if i remove that class then problem may be solve. But i need that class. I have no idea how to solve this problem????
If you don't want to use the
CCriticalSection
class from MFC, try using the Win32 synchronization functions: EnterCriticalSection[^] LeaveCriticalSection[^]It is a crappy thing, but it's life -^ Carlo Pallini
-
shivanandgupta wrote:
Then got many error
What is the exact error message(s) ? You realize that your question is totally vague ?
Cédric Moonen Software developer
Charting control [v2.0] OpenGL game tutorial in C++I get a lot of Compile time errors (C2872) CCriticalSection Ambiguous Symbol.
-
If you don't want to use the
CCriticalSection
class from MFC, try using the Win32 synchronization functions: EnterCriticalSection[^] LeaveCriticalSection[^]It is a crappy thing, but it's life -^ Carlo Pallini
I get a lot of Compile time errors (C2872) CCriticalSection Ambiguous Symbol. I can not remove CCriticalSection Class.
-
I get a lot of Compile time errors (C2872) CCriticalSection Ambiguous Symbol.
Are you redefining a CCriticalSection object somewhere in your own code ?
Cédric Moonen Software developer
Charting control [v2.0] OpenGL game tutorial in C++ -
I get a lot of Compile time errors (C2872) CCriticalSection Ambiguous Symbol.
Are you including
afxmt.h
? Have you read this?"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
-
I get a lot of Compile time errors (C2872) CCriticalSection Ambiguous Symbol.
I recently encountered this ambiguous symbol issue and found a solution. Posting here in this old thread for reference. I had the same issue in a project where I needed to include both <afxmt.h> and <atlsync.h>. They each have a similar set of concurrency classes with the same names -- but for a given class some of the member functions are distinct. In Visual Studio 2022 build 17.4.3 with the latest Windows 10 SDK (and perhaps in older IDEs and SDKs), you can reference classes from both of these headers without ambiguity, so long as you: 1) Include
afxmt.h
BEFORE includingatlsync.h
, e.g. `#include ` `#include ` 2) Do NOT specifyusing namespace ATL
3) To reference a class inatlsync.h
, preface the class name withATL::
, e.g.ATL::CEvent
orATL::CSemaphore
. If you do not add thisATL::
namespace preface, the class will be referenced fromafxmt.h
.