Just Let It Flow

May 7, 2011

DLL – Demystifying Loader Lapses

Filed under: Code,Windows — adeyblue @ 12:17 am

DLL hell isn’t just the name given to managing monstrous dependency chains. It’s also the name given to the phenomenon of pulling your hair out because LoadLibrary is returning NULL or because you dotNet app is throwing lots of System.DllNotFoundExceptions. The usual statement Windows gives as witness to these crimes is ‘Module not found’ as if it were some blind referee or umpire giving a call against the local sports team, but like Bud Selig calling the All-Star game a tie, Windows levels the playing field by housing a certain tool you can leverage. And without having to write any more code in investigative anger or download anything too.

March 2, 2011

U-A-Ceen Nothing Yet

Filed under: Code,Windows — adeyblue @ 1:38 am

Detecting whether UAC is enabled or not is something I’ve never needed to do. I can’t really see how it can affect anything you architect one way or another but nevertheless, some people think it’s necessary and nice to know.

January 29, 2011

WMI’m Going Speed Dating

Filed under: Code,Windows — adeyblue @ 12:21 am

There’s tonnes of example on how to use SWbemDateTime to convert from FILETIME’s or CDates in VBScript, yet I couldn’t find any for C++. So here’s how…

April 19, 2010

A Token Difference

Filed under: Code,Windows — adeyblue @ 11:46 pm

During the course of an application, there will usually be times when it needs to do something requiring administrative powers. If the user is a true standard user and not just a standard running admin, then any elevated process it launches will be running as a different user.

In this, and every other scenario with a program running under a secondary logon, just how do you figure out who real interactive Slim Shady is, and how do you get him to stand up?

January 18, 2010

A Whole Heap of Trouble

Filed under: Code,Windows — adeyblue @ 4:21 am

The heap manager, every program uses it. Whether hidden behind the CRT, COM, OLE, or the crusty old Local/GlobalAlloc, it’s at the centre of the vast majority of memory related operations. Dealing out memory and reclaiming it are no doubt its most common utilities but it has a few more tricks up its sleeve.

November 5, 2009

It Seems to be Some Sort of Communiqué

Filed under: Code,Windows — adeyblue @ 12:10 am

Just what are all the WM_ message names?

October 3, 2009

Desktop Heap Monitor for Windows Vista, Server 2008 and 7

Filed under: Code,Windows — adeyblue @ 8:49 pm

Desktop Heap Monitor is a debugging tool that displays the consumption of desktop heaps in the current session. Due to its reliance on undocumented internal structures or maybe just because it’s not an efficient use of time, Microsoft has so far decided not to release an update to allow it to work on OS’s post Server 2003. So as I was doing some work in this area, I’ve created an update to let it do just that.

August 8, 2009

Maximizing the Console Window (Completely)

Filed under: Code,Windows — adeyblue @ 12:35 am

It seems that when it comes to the web, most people are under the impression that the maximum size for a Windows console is what you get when you “maximize” one. It’s time they thought again…

July 15, 2009

The Application Configuration is Never Correct

Filed under: Code,Windows — adeyblue @ 1:11 am

If you’ve used Visual Studio 2005 or 2008 and tried to run something you created on a different computer than the development one, chances are that your attempts how fallen foul of SxS errors. Here’s a simple way to make your app work regardless of which versions, if any, are installed on the target computer.

March 12, 2009

UNICODE Independence

Filed under: Code,Windows — adeyblue @ 7:16 am

As everybody who’s ever done some Windows programming knows, string handling functions come in two flavours. A versions for char based strings, and W versions for WCHAR based strings with the actual function names being macros that expand to the correct versions depending on whether UNICODE has been defined. This is fine and all, but since macros are generally frowned upon in C++ surely there’s a better way to go about this? Surely there’s a method that’ll choose the correct version of the function to use based on whatever type of string the function is given.

« Newer PostsOlder Posts »

Powered by WordPress