Wrapping C++ objects in C

Introduction Using C functions from C++ is very easy but going the other way isn’t. However, it can be done with a little ingenuity. Really, this isn’t as crazy as it sounds. I’ll use a simple adder for the object. It takes an integer as a starting value and has two functions for adding and […]

s2n Memory Hardening Analysis

Recently Amazon.com introduced s2n as a new TLS implementation. The idea is to have a small and simplified TLS library. Looking at it I noticed it’s very Linux centric. It cannot be compiled on Windows. There are patches to make it work on OS X. There is a report that it works on FreeBSD but […]

Effective Threading Using Qt

Effective Threading Using Qt Introduction Over the years using Qt I’ve seen a lot of difficulty using threads with Qt. Threads can be difficult and Qt provides a lot of ways to make threads easy to work with. Still basic / direct / low level threading (I’ll just call this basic) is often seen as […]

Extending an Application with Lua Plugins

Introduction A very common use of the Lua language (which is a very versatile) is using Lua to extend an application via plugins. Many popular games use Lua for this very purpose. Adding a plugin framework to an existing application is trivial with Lua. Also, Lua provides a very capable and easy to use language […]

Calling Functions in EXE From Plugins in Windows

When writing an application that uses plugins sometimes it’s necessary to have the plugin call functions from the application. This is fairly easy to do on pretty much any OS but on Windows it requires the plugin to link to the application. Sometimes explicit linking is unreasonable. One situation where you don’t want the plugin […]

Wrapping a C library in COM/ActiveX

Introduction Not very long ago my boss walked up to my desk, put a pile of books down beside me and said “Not it”. The books were all related to COM programming. The project he gave me was to create a COM wrapper for an existing C library we had developed. Windows is not my […]

Qt Remove Directory and Its Contents

When dealing with directories, Qt has a large number of functions to make manipulating them easy. However, it does not include a way to delete a non-empty directory. This little omission is easily solved. Following is a recursive function that will delete a directory along with all of it’s contents. This will delete depth first. […]

C++ Derived Classes and Object Destruction

While working on lebookread I realized that the the destructor for my reader classes would never be called. lebook read has a base class (FormatReader) that exports all of the necessary functionality for use by applications using the library. All of the readers are a subclass of FormatReader. The library will find the appropriate reader […]

lebookread

I have been taking a short break from blogging again. The pressure at work has only increased and is eating into a lot of my time. I haven’t been motivated to work on personal projects because well they are work. However, this has recently changed a bit. I’ve started a Qt based library for reading […]