Tuesday, January 31, 2006

Class member functions as callback functions in MFC

To use them that way, declare the functions as static.

Check this for more info.

Mathematics and Computer Programming


Converting INTEGER to CHAR in MFC

int i =100;
char test[20];
atoi(i, test,10);


Monday, January 30, 2006

Steve Jobs' Magic Kingdom

Business Week

Matter bound by light


Buttons' galore


Friday, January 27, 2006

Instance of current MFC application

To get the instance handle to the current MFC application,

hInstance = AfxGetInstanceHandle() ;

Thursday, January 26, 2006

GetFileVersionInfo error

Trying to integrate a C++ MFC project with an existing Win32 C project. GetFileVersionInfoSize throws up the following errors:

PicomCD error LNK2001: unresolved external symbol _GetFileVersionInfoA@16
PicomCD error LNK2001: unresolved external symbol _GetFileVersionInfoSizeA@8
PicomCD error LNK2001: unresolved external symbol _VerQueryValueA@16

This is removed by including the following line in the cpp file:

#pragma comment(lib, "version.lib")

Tuesday, January 24, 2006

Top 10 .NET / C# links


MFC error LNK 2005:

already defined in .obj

whenever I try to use extern keywords to access global variables defined in another file of the project.

trying to integrate C code written in Win32 to MFC C++

To Solve (quickest method)

Project > Properties > Linker > Command Line > Additional Options > Type /FORCE

Monday, January 23, 2006

LPUINT error

Trying to integrate a C++ MFC project into an existing Win32 project in C.

The following error is thrown up wherever LPUINT is present

syntax error : identifier 'LPUINT'

To remove the error , we need to go to the stdafx.h file in the MFC project and comment out

#define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers

Commenting out the above portion, now makes the project run fine.

Friday, January 20, 2006

Tracing an email


Thursday, January 19, 2006



Sunday, January 15, 2006

Download Google video in .avi format


Wednesday, January 11, 2006

CListCtrl in MFC

2 ways to use list controls in MFC:
  1. Directly embed CListCtrl object in the dialog class
  2. Indirectly by using the CListView class
CListView makes it easy to integrate with the document/view architecture.

CListCtrl& ctlList = GetListCtrl();

Callback Mask - set of bit values flags which specify the item states for which the application stores the current data
applies to all of the control's items, and is 0 by default

During CListView, the control is created in the view's OnCreate handler function

Using CListCtrl directly is done through the ClassWizard method. ( the not so intuitive classwizard in VC 7 ....phew! )
Using classwizard, add a member variable and declare map handler functions

CImageList - to create one or more image lists

25 reasons to convert to Linux


Tuesday, January 10, 2006

How to create Firefox extensions


Open Source Flash player


Assertion error with MFC CListCtrl

'Debug Assertion failed'

Google groups thread

Highlight images on webpages

Lightbox JS : Cool Javascript to highlight images on webpages

Sunday, January 08, 2006

The softening of a software man


Friday, January 06, 2006

DevCentral MFC tutorials


An example MFC program



// Declare the application class
class CHelloApp : public CWinApp
virtual BOOL InitInstance();

// Create an instance of the application class
CHelloApp HelloApp;

// Declare the main window class
class CHelloWindow : public CFrameWnd
CStatic* cs;

// The InitInstance function is called each
// time the application first executes.
BOOL CHelloApp::InitInstance()
m_pMainWnd = new CHelloWindow();
return TRUE;

// The constructor for the window class
// Create the window itself
"Hello World!",
// Create a static label
cs = new CStatic();
cs->Create("hello world",
The program is doing three things:

1. Creating the application object
Every program has a single application object that handles the initialization details of Windows and MFC

2. The application then creates a single window on the screen to act as the main application window

3. Inside the window, the application creates a single static text label containing the words 'hello world"

1. Declare the application class
2. Create an instance of the application class
3. Declare the main window class
4. InitInstance function is called each time the application first executes
5. Constructor for the window class
1. Create the window
2. Create the static label

Thursday, January 05, 2006

Welcome to Mars Express, only a 3hr trip




MFC Stuff

Some MFC stuff from CoderSource

Tuesday, January 03, 2006

A brief look at C++0x

Artima Developer


Monday, January 02, 2006

Visual C++ , MFC


Revenge of the dotcom poster boy