Browsed by
Category: Software Snippets

SubWCRev Generates Wrong Times

SubWCRev Generates Wrong Times

We want to run SubWCRev as an automated step in our process so we have the latest SVN metadata included in our executable. This makes it easier to identify executables as the file properties can include information about SVN revision numbers, build times, etc… However, if we automatically trigger the build with Cygwin, we can end up generating the wrong timestamps: This appears to be working fine for a GMT+1 time zone, except we’re on the other side of the…

Read More Read More

Disable RDP Auth Popup

Disable RDP Auth Popup

When using Remote Desktop Connection, you can get a popup window asking for your login credentials before a connection to the remote machine is made. When it works, you can use these credentials to bypass the remote machine’s authentication screen and login directly. However, this popup can cause a login failure if the authentication methods don’t match, or be very annoying if you want to login to test machines using a range of account usernames, or accounts with no password….

Read More Read More

Processes, Symlinks, & Windows 10

Processes, Symlinks, & Windows 10

When starting external executables from C++ code, if we start them using SHELLEXECUTEINFO on Windows 10, we cannot maintain a process handle across symlinks like we can on Windows 8. Starting the process using: We should have a value for execInfo.hProcess for the executable the symlink points to as we do in Windows 8. On Windows 10, the executable will start but the process link is not established. Therefore, it will not be possible to read data back from or…

Read More Read More

Sending Unicode through Windows Pipes

Sending Unicode through Windows Pipes

Passing unicode data through Windows Pipes sometimes requires special handling to avoid having the pipes scramble the data. We can see this using the cmd prompt and navigating to a path containing unicode characters. The unicode characters cannot be typed, or rendered on screen (showing as question marks instead), though we can use tab complete to type the unicode path. If we are passing data from one program to another through a pipe controlled through a CreateProcess call, we can…

Read More Read More

Mouse Buttons in Win32

Mouse Buttons in Win32

To respond to special mouse button actions in Win32, we need to register the virtual command actions with the callback loop to detect the special mouse button action. For example, to detect forward and backward mouse button actions, we register the APPCOMMAND_BROWSER_FORWARD and APPCOMMAND_BROWSER_BACKWARD events: Should the WM_APPCOMMAND options not work, you might want to look into the VK_* event codes.

Reading wide characters with wifstream

Reading wide characters with wifstream

Should we want to use wifstream to read unicode characters directly from a file, we will encounter an implementation quirk with newline detection in the standard library. Carriage returns and line feed (CR/LF) characters contained within certain characters as a part of a character’s unicode encoding can be mistaken by std::getline for the newline character. This mix-up then causes std::getline to split lines of text in half. wifstream provides a unicode wide character interface to the std library’s file operation…

Read More Read More

WordPress Updates asks for FTP Credentials

WordPress Updates asks for FTP Credentials

When attempting to run wordpress updates, wordpress can ask for ftp credentials. This can be caused by a conflict between the user/group ownership of the wordpress installation’s files and the webserver’s user credentials. The easiest way to fix this is to match the file ownership with the webserver’s user account:

Manual Flash Player Updates

Manual Flash Player Updates

While the Flash Player updates usually run automatically on machine restart, it is possible to keep Flash up to date while still running important operations. We can keep the machine running, and keep Flash up to date, by manually starting the update with the command:

MSB6001

MSB6001

While Software Engineers are undoubtedly more familiar with the C#### or LNK#### errors generated by Visual Studio, MSB#### errors are more indicative of a problem with the compile or compile environment instead of with the code being compiled. While working on build automation using cygwin, I encountered a number of MSB6001 compile errors. They are generated due to a mismatch between how cygwin, being a linux shell, and the underlying Windows system, handle environment variables. We can see a selection…

Read More Read More