Newbie question about CeSetThreadPriority RRS feed

  • Question

  • I am a newbie to real-time programming.  It is my understanding that CeSetThreadPriority only runs on Windows CE and that I can't use it on regular Windows.   I looked around for complete examples or sample code of how to set up a project to use CeSetThreadPriority but couldn't find anything substantial.   Searched for the term here on msdn and nothing comes up.   I am assuming that Win32 is the type of project that I need to select.   Do I need to install the special CE Toolkit for Visual C++ in order to use it or does it just work in standard Visual Studio 2010?  
    Tuesday, February 15, 2011 6:32 PM

All replies

  • CeSetThreadPriority is a Win32 API specific to Windows CE.  To use it within a VS project, you will want to use any of the "Smart Device" project types and have an SDK installed for your target CE device.  VS2010 does not currently support this type of development so you will need to use VS 2005 or VS 2008 to create your Smart Device project.
    Tom Gensel PTG Systems, LLC
    Tuesday, February 15, 2011 6:46 PM
  • Tuesday, February 15, 2011 7:35 PM
  • Thanks Tom, I think you saved me a ton of time.  I would have been trying to get this to work in VS2010 to no avail.   As for my target CE device we are using the latest top of the line PC as of summer 2010.   We currently have windows 7 ultimate running on it.    There is a data acquisition application running on it and we want to specify that this application, and the network drivers used to send the data to the ground computers, above all else have tip-top priority on this computer.   I'm thinking about just creating a DLL library with a single function, to get and set current thread priority, in VS2008.   The rest can be done in 2010.   Once compiled the library can be referenced in the 2010 work.  Does that sound like a feasible workaround to get this CeGet/SetThreadPriority to work with 2010? 

    Wednesday, February 16, 2011 6:56 PM
  • If your application is going to run under the Windows 7 Ultimate OS, you won't be using CeSetThreadPriority (or a Smart Device application or a CE device SDK). Your application would be a desktop Windows application and use the desktop Windows API SetThreadPriority.  That type of application CAN be developed on VS2010.  Only if you wanted to run Windows Embedded Compact OS (i.e. Windows CE) on this PC would your application need to be a Smart Device applicatin and use the CE-specific CeSetThreadPriority API.
    Tom Gensel PTG Systems, LLC
    Wednesday, February 16, 2011 7:28 PM