Here’s a code snippet that enumerates the currently enabled network adapters and shows some info for each adapter :- PIP_ADAPTER_INFO pAdapterInfo = NULL; ULONG OutBufLen = 0; //Get the required size of the buffer if( GetAdaptersInfo(NULL, &OutBufLen) == ERROR_BUFFER_OVERFLOW ) { int divisor = sizeof IP_ADAPTER_INFO; /*** Uncomment for VC++ 2005 Beta 2 if( sizeof [...]
Entries from May 2005
Retrieving network adapter info using the IP Helper API
May 30th, 2005 · 5 Comments
Tags: Win32/MFC
Accessing version information is so damn hard
May 25th, 2005 · 3 Comments
I am unable to fathom why there is no straightforward API to access version information from the running process. To retrieve any kind of version information, you need to call 3 APIs – GetFileVersionInfoSize, GetFileVersionInfo and VerQueryValue. Actually make that 4 APIs, since you also need to call GetModuleFileName to get the full path of [...]
Tags: Win32/MFC
Three recent CP articles
May 19th, 2005 · 1 Comment
I’ve been writing articles the last couple of weeks and for those who missed them, here are the URLs :- C++/CLI Properties – Syntactic sugar for accessor methods StringConvertor : A convertor class for managed-unmanaged string conversions that handles memory de-allocations CNullable : A convenient Nullable equivalent class for C++/CLI All of them started off [...]
Tags: General
STL.NET in VC++ 2005 Beta 2
May 10th, 2005 · 12 Comments
Anson Tsao says it was an accidental inclusion and Ronald Laeremans says it isn’t within an order of the magnitude of the performance that they wanted to ship it with. Anson said that the idea is to release STL/CLR (or STL.NET) as a beta (downloadable off the web) around the time VC++ 2005 is finally [...]
Tags: C++/CLI
A more .NETish main()
May 9th, 2005 · 6 Comments
In VC++.NET 2005 Beta 2, if you create a new .NET console app project (now aptly called a CLR console app in the wizard), you’ll see that the generated main() function is prototyped thus :- int main(array<System::String ^> ^args) That’s rather neat – considering that we are using .NET, it makes sense to have a [...]
Tags: C++/CLI
Transcript of my MSDN chat
May 4th, 2005 · No Comments
For those of you who tragically missed my chat and are going through serious attacks of depression because of it, here’s some good news. You can download a transcript of my chat here (PDF version) :- Visual C++ 2005 – Language Enhancements You’ll need a PDF reader (most of you should have Adobe’s reader installed, [...]
Tags: General