What the heck is svsutil.hxx?
If you've ever searched through the public sample code of Windows CE, you may have noticed the headerfile svsutil.hxx being included and weird "SVSBlahBlahBlah" classes and functions being called. SVSUtil.hxx is a set of common programming utilities that we on the WinCE CoreOS team use to avoid duplicating code. In this header file are things like basic data structure helpers for trees/queues/hashes/lists/..., a thread pool, XML parsing and generation helpers, and more.
Unfortunately none of these helpers are documented. The good news is that most of the code to them is implemented in the header file itself, which means that you can figure out what's going on by inspection.
Should you be copying and pasting code that is already using svsutil.hxx (or should you want to use part of it yourself), then you do have to take some extra steps. First, you'll need to link against ceosutil.lib. Ceosutil.lib is where the functions not inlined in svsutil.hxx are implemented. Before actually calling any svsutil functions, you'll need to call svsutil_Initialize(). When you're done, you'll need to call svsutil_DeInitialize(). Both of these functions are "DLLMain() safe", so most people just put the calls in DllMain.
Some of the svsutil.hxx stuff is dated; parts of it were created before the OS had a decent template mechanism. Templates are a cleaner solution for a lot of the data structure helpers. However some of the other stuff remains extremely useful, such as the thread pool.
The SVS, contrary to popular belief, does not stand for services. It is actually the initials of my former boss who first created the file. I was tempted to rename the file JCSUtil when that boss left the group, but JCS doesn't map to anything that people would believe meant something legitimate :).
[Author: John Spaith]
Comments
- Anonymous
August 22, 2005
I get an error when trying to compile with this header: svsutil.hxx(2652) : error C2362: initialization of 'dwPreviousDelta' is skipped by 'goto done'. When I try fixing the problem, the EVC++ complains that now the library debug info is out of sync. Either way, I can't compile. Help? - Anonymous
December 10, 2007
After goolge this paragraph, I finally know the key is to link to ceosutil.lib... - Anonymous
January 22, 2008
If you try to build svsutil.hxx on certain versions of the Windows Mobile SDK, you may run into build - Anonymous
January 22, 2008
If you try to build svsutil.hxx on certain versions of the Windows Mobile SDK, you may run into build - Anonymous
January 21, 2009
PingBack from http://www.keyongtech.com/3101289-com-in-a-service