Embedding Python in C++

Adding python scripting capabilities to your code is an interesting thing to do, it can help you enhance an application without as much hard work. This is just an example on how to use code from memory as part of your program.

// Embedded Py.cpp

#include "stdafx.h"
#undef _DEBUG /* Link with python24.lib and not python24_d.lib */

using namespace std;


Playing with templates

Dumb strokes of C++ templates while bored generated this templated queue.

#define QueueSize 5

class Queue

Queue() : head(NULL), tail(-1) { for (int i=0; i < QueueSize; queue[i++]=NULL); }
void insert(T in);
bool isEmpty() { return ( queue[head] == NULL ) ? true : false; }
bool isFull() { return (head == tail && queue[head] != NULL) ? true : false; }
T remove();
void showContents();

T queue[QueueSize];
int head, tail;


Audio Player DLL

Well this project involves a lot of things that definitely are
entertaining. It started as a Audio Playing DLL. Vague? You bet.
Anyway, this DLL is nothing more than an MP3 player or was. I started
writing and got more excited everytime and eventually I decided to make
it compatible with XPCOM, and use it to play audio through mozilla.
I actually wrote that piece of code and its stashed somewhere!


Subscribe to RSS - c++