Browse by Tags

All Tags » C++ (RSS)

Writing Solid Code

My apologies to Steve Maguire for "borrowing" a title. I constantly see code, examples, and advice that perpetuate unsafe coding practices. As programmers we have the habit of getting something to a "working" state and call it "done"...

Has ANSI C/C++ Been Perpetuating Unsecure Computing?

Whatever Happened to sprintf(..., "%n", ...)? Strsafe.h: Safer String Handling in C Security Enhancements in the CRT Many 3rd party libraries model their API around the ANSI C/C++ libraries, introducing the capability of buffer overruns. Is...
Posted by PeterRitchie | with no comments

Save CBitmap to File

It has always astounded me why the CBitmap class never implemented saving to a file. Here's a nice and tidy way: #include <atlimage.h> #include <Gdiplusimaging.h> //... CBitmap bitmap; bitmap.CreateBitmap(width, height, 1, 32, rgbData...