Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Build Error When Include Web Service in MFC application

Build Error When Include Web Service in MFC application

Scheduled Pinned Locked Moved C / C++ / MFC
helpc++tutorialquestion
8 Posts 5 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Shivanand Gupta
    wrote on last edited by
    #1

    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????

    C R 2 Replies Last reply
    0
    • S Shivanand Gupta

      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????

      C Offline
      C Offline
      Cedric Moonen
      wrote on last edited by
      #2

      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++

      S 1 Reply Last reply
      0
      • S Shivanand Gupta

        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????

        R Offline
        R Offline
        Rajesh R Subramanian
        wrote on last edited by
        #3

        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

        S 1 Reply Last reply
        0
        • C Cedric Moonen

          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++

          S Offline
          S Offline
          Shivanand Gupta
          wrote on last edited by
          #4

          I get a lot of Compile time errors (C2872) CCriticalSection Ambiguous Symbol.

          C D M 3 Replies Last reply
          0
          • R Rajesh R Subramanian

            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

            S Offline
            S Offline
            Shivanand Gupta
            wrote on last edited by
            #5

            I get a lot of Compile time errors (C2872) CCriticalSection Ambiguous Symbol. I can not remove CCriticalSection Class.

            1 Reply Last reply
            0
            • S Shivanand Gupta

              I get a lot of Compile time errors (C2872) CCriticalSection Ambiguous Symbol.

              C Offline
              C Offline
              Cedric Moonen
              wrote on last edited by
              #6

              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++

              1 Reply Last reply
              0
              • S Shivanand Gupta

                I get a lot of Compile time errors (C2872) CCriticalSection Ambiguous Symbol.

                D Offline
                D Offline
                David Crow
                wrote on last edited by
                #7

                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

                1 Reply Last reply
                0
                • S Shivanand Gupta

                  I get a lot of Compile time errors (C2872) CCriticalSection Ambiguous Symbol.

                  M Offline
                  M Offline
                  mike4online
                  wrote on last edited by
                  #8

                  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 including atlsync.h, e.g. `#include ` `#include ` 2) Do NOT specify using namespace ATL 3) To reference a class in atlsync.h, preface the class name with ATL::, e.g. ATL::CEvent or ATL::CSemaphore. If you do not add this ATL:: namespace preface, the class will be referenced from afxmt.h.

                  1 Reply Last reply
                  0
                  Reply
                  • Reply as topic
                  Log in to reply
                  • Oldest to Newest
                  • Newest to Oldest
                  • Most Votes


                  • Login

                  • Don't have an account? Register

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • World
                  • Users
                  • Groups