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. About Threading model

About Threading model

Scheduled Pinned Locked Moved C / C++ / MFC
helpc++comwindows-adminquestion
3 Posts 3 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
    siddharthsan
    wrote on last edited by
    #1

    :((Hi, I am using Windows CE platform for my flashlite plugin application development.In the registry file(.rgs),threading model is set to Both to support both the STA and MTA. Because of the threading model, I am getting fatal error as , "Single-threaded COM objects are not properly supported on Windows CE platform, such as the Windows Mobile platforms that do not include full DCOM support. Define _CE_ALLOW_SINGLE_THREADED_OBJECTS_IN_MTA to force ATL to support creating single-thread COM object's and allow use of it's single-threaded COM object implementations. The thr:((eading model in your rgs file was set to 'Free' as that is the only threading model supported in non DCOM Windows CE platforms." So, I changed the apartment type is changed to free,apartment etc. like ThreadingModel = Both ThreadingModel = Free ThreadingModel = Apartment But I am getting the same error.It is related to _WIN32_WCE macro? Please help me to solve this error... Siddharth

    D M 2 Replies Last reply
    0
    • S siddharthsan

      :((Hi, I am using Windows CE platform for my flashlite plugin application development.In the registry file(.rgs),threading model is set to Both to support both the STA and MTA. Because of the threading model, I am getting fatal error as , "Single-threaded COM objects are not properly supported on Windows CE platform, such as the Windows Mobile platforms that do not include full DCOM support. Define _CE_ALLOW_SINGLE_THREADED_OBJECTS_IN_MTA to force ATL to support creating single-thread COM object's and allow use of it's single-threaded COM object implementations. The thr:((eading model in your rgs file was set to 'Free' as that is the only threading model supported in non DCOM Windows CE platforms." So, I changed the apartment type is changed to free,apartment etc. like ThreadingModel = Both ThreadingModel = Free ThreadingModel = Apartment But I am getting the same error.It is related to _WIN32_WCE macro? Please help me to solve this error... Siddharth

      D Offline
      D Offline
      DevMentor org
      wrote on last edited by
      #2

      Are you sure you're not doing something wrong? I am sure single-threaded COM is supported in WinCE as this is very easy to do. COM does this by using a hidden window and a message loop to serialize the calls aka com marshalling. Do you have the source code for the COM object, can you build it for WinCE and then try to register the com object. Possibly the existing COM object was never built to run on WinCE as some one the APIs on WinCE are light-weight and don't transfer easily from Win32 platforms.. this is what I've read as I have never developed for a WinCE platform. You can't simpley change a COM object that was STA to MTA free threading model because then your object is not thread safe and will have all kinds of data corruption bugs! You also need to build a thread safe COM object besides the registry setting. Also STA and MTA support has nothing to do with DCOM!

      Yours Truly, The One and Only!

      1 Reply Last reply
      0
      • S siddharthsan

        :((Hi, I am using Windows CE platform for my flashlite plugin application development.In the registry file(.rgs),threading model is set to Both to support both the STA and MTA. Because of the threading model, I am getting fatal error as , "Single-threaded COM objects are not properly supported on Windows CE platform, such as the Windows Mobile platforms that do not include full DCOM support. Define _CE_ALLOW_SINGLE_THREADED_OBJECTS_IN_MTA to force ATL to support creating single-thread COM object's and allow use of it's single-threaded COM object implementations. The thr:((eading model in your rgs file was set to 'Free' as that is the only threading model supported in non DCOM Windows CE platforms." So, I changed the apartment type is changed to free,apartment etc. like ThreadingModel = Both ThreadingModel = Free ThreadingModel = Apartment But I am getting the same error.It is related to _WIN32_WCE macro? Please help me to solve this error... Siddharth

        M Offline
        M Offline
        Matthew Faithfull
        wrote on last edited by
        #3

        Seems a bit odd. I use COM on CE all the time and have never seen this problem but I suppose that's because all our stuff is multithreaded. If you have control over your CE platform it's possibly worth experimenting with putting DCOM back in. Our CE 5.0 has it, Microsoft just took it out by default because some things don't work. We have plenty of components with ThreadingModel='Both' I would suggest you develop an empty or dummy COM object specifically targetted at CE, using the EVC4 compiler (which is fussier than the regular VC compilers) to make sure you can get the infrastructure working. Once you've got a working shell you can port the useful code into it. You could always create a free threaded component and simply wrap every entry point with the same critical section so that old single threaded code can be used internally without breaking anything. It's not highly efficient but it should work.

        Nothing is exactly what it seems but everything with seems can be unpicked.

        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