The small application is a goos sample and useful tool in the same time. It enumerates PE binary resources and counts languages used. Why? Normally you want single language of resources, however Visual Studio IDE does not show you languages in a convenient way and it is so easy to make a language mess which does not bite you immediately but might bring you troubles later. Apart from this there was a suspicion that language mess might cause runtime bugs on UpdateResource API.
The application gets you a summary of languages used and returns with exit code (checkable using e.g. errorlevel) indicating number of languages.
Output is TSV: LANGID, Language Name, Resource Count:
C:\>ListResourceLanguages.exe C:\Windows\syswow64\shell32.dll
1049 Russian 5451033 English 3318
This update for Resource Tools adds an option to access custom resource types, such as FILE, TYPELIB, REGISTRY etc. It lets enumerate the resource, and load/save them. The COM interafce adds new Items property; the code snippet below accesses type library of image2.dll and saves it into external tyle library file image2.tlb:
Additionally, image.EndUpdate(false) call makes the object close all references to the underlying file so that it can be available for other operations (e.g. overwrite), and the COM object might be further re-initialized and reused.
One of the nasty issues with LogProcessExceptions utility was that it was unable to attach to service processes and track them to catch their exceptions.
The actual problem was that the processes were not listed in first place, so there was nothing to attach to. Access and security requirements necessary for a process to debug another process are listed in MSDN DebugActiveProcess article:
The debugger must have appropriate access to the target process, and it must be able to open the process for PROCESS_ALL_ACCESS. DebugActiveProcess can fail if the target process is created with a security descriptor that grants the debugger anything less than full access. If the debugging process has the SE_DEBUG_NAME privilege granted and enabled, it can debug any process.
The utility did enable the SE_DEBUG_NAME privilege, however it was doing it prior to starting debugging session and after the process of interest was already pointed to by user.
This was insufficient because EnumProcesses only lists service processes (not actually exactly services, but processes running in different security context) in case debug privilege is already enable by the time of the API call. The utility now enabled the privilege well in advance and list the services, so can be effectively applied to those.
Download links:
Partial Visual C++ .NET 2010 source code: Trac, Subversion
Today’s update lets you convert multiple locations at once with a single click. Here is the story behind the update and use case scenario.
In rally raid sport events (so called baja), a team gets a road book for the next competition day in a few hours before actual start. The GPS coordinates are printed on one of the pages of the roadbook and are not available in any electronic format.
There were just a few times when the organizer also uploaded a copy of a file with the coordinates and shared a link to download from, but this was rather an exception. Another alternate option was a dedicated person to upload the coordinates (they were earlier full tracks, but at some point tracks were no longer available at all) to pilots’ hardware, but in a state of pre-start рфыеу and variety of GPS hardware, formats, cable etc. this created lines of people. The most one can rely on is a sheet of paper with GPS coordinates. The mistery does not end even here as you don’t know whether you are to get Degrees only, or Degrees and Minutes, or Degrees, Minutes and Seconds. Everything depends on software the organizer uses.
As soon as you get a hard copy of this, the idea is to upload it into device as quickly as possible because there are other things to do and the time is normally 11 PM when the race is to start 7 AM next day tens of miles away from you. The time interval will be shared by uploading data, sleeping and transfer to start location.
The utility is here to grant extra sleep time. Since it is capable to accept various separators on the input, a convenient way is to quickly type in the text in Microsoft Excel, check the data against the hardcopy, and copy into clipboard to transfer to the utility.
A hotkey with conversion transfers data into format of interest, and single “Find and Replace” operation creates a good OziExplorer waypoint file which is good for upload onto portable navigation device.
The whole thing take a few minutes to do with minimal routine typing in.
This tool came up as a result of mess around GPS coordinate formatting and variety of popular formats and notations. Some use latitude and longitude degrees, some prefer degrees and minutes with fractional part. this does not take into account choices for datum and file formats.
For instance, both Google Maps and Yandex Maps accept latitude and longitude as ll= URL parameter with the value of latitude and longitude in degrees, however Google uses latitude coming first, while Yandex prefers the opposite.
Recently, a rally road book contained the following formatting of track points:
Having to put a stop to the madness, this utility comes up as a handy assistant to convert and format GPS coordinates into reasonable presentation and separators.
The utility runs on background and monitors clipboard, and once it recognizes one of the following:
GPS Point in Degrees
GPS Point in Degrees and Minutes
GPS Point in Degrees, Minutes and Seconds
Google Maps URL
Yandex Maps URL
it flashes and updates its UI providing the choices of track point formatting:
The utility is trying hard to accept various separators and formats, just one thing is important to keep in mind: if you are using minutes without seconds, the fractional part of minutes should be separated by decimal point (.).
The utility also responds to hotkeys Ctrl+Shift+F1, Ctrl+Shift+F2 etc. and copies the formatted point location back into clipboard so that one could quickly re-format editable text in another application through clipboard updates. Alternatively, it is possible to click the formatted value and place it into clipboard.
The utility also provides clickable hyperlinks to open Google Maps and Yandex Maps into the point of interest.
As 64-bit version of Windows operating systems provide two versions of shell explorer, and support both Win32 and x64 platform applications, it is typical to install both 32-bit and 64-bit versions of the utility to cover/extend applications of both platforms. Note that 32-bit (Win32) applications can only load and directly interact with 32-bit builds of libraries (DLLs), so 64-bit (x64) applications need a corresponding matching version of the shell extension available.
As the utility provides a shell extension for directory property pages, here comes a curiosity exercise: how Windows 7 uses junction points to cross-map directories under user profile directory, e.g. C:\Users\<username>\Local Settings directory is actually a shortcut to C:\Users\<username>\AppData\Local.
Current version of Alax.Info NTFS Links can be downloaded from:
Important: if you have a DirectShow question which is not directly related to posted material, please rather post it at DirectShow Development MSDN Forum, especially instead of asking me in the website chat.
Recent Comments