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

http://epsilondelta.wordpress.com/

Converting INTEGER to CHAR in MFC

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

AfxMessageBox(test);

Monday, January 30, 2006

Steve Jobs' Magic Kingdom

Business Week

Matter bound by light

http://physicsweb.org/articles/news/10/1/8/1

Buttons' galore

http://gtmcknight.com/buttons/

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

http://www.newsgarbage.com/story/298/

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

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

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

Friday, January 20, 2006

Tracing an email

http://www.onimoto.com/cache/50.html

Thursday, January 19, 2006

PACS

http://economictimes.indiatimes.com/articleshow/1376950.cms

Sunday, January 15, 2006

Download Google video in .avi format

http://www.querocarromogi.com/videogoogle/

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

http://www.bellevuelinux.org/reasons_to_convert.html

Tuesday, January 10, 2006

How to create Firefox extensions

Interesting

Open Source Flash player

GNASH

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

http://nymag.com/nymetro/news/columns/powergrid/15456/index.html

Friday, January 06, 2006

DevCentral MFC tutorials

http://devcentral.iticentral.com/articles/MFC/default.php

An example MFC program

//hello.cpp

#include

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

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

// Declare the main window class
class CHelloWindow : public CFrameWnd
{
CStatic* cs;
public:
CHelloWindow();
};

// The InitInstance function is called each
// time the application first executes.
BOOL CHelloApp::InitInstance()
{
m_pMainWnd = new CHelloWindow();
m_pMainWnd->ShowWindow(m_nCmdShow);
m_pMainWnd->UpdateWindow();
return TRUE;
}

// The constructor for the window class
CHelloWindow::CHelloWindow()
{
// Create the window itself
Create(NULL,
"Hello World!",
WS_OVERLAPPEDWINDOW,
CRect(0,0,200,200));
// Create a static label
cs = new CStatic();
cs->Create("hello world",
WS_CHILD|WS_VISIBLE|SS_CENTER,
CRect(50,80,150,150),
this);
}
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

Scotsman

Slashdot

NewScientist

MFC Stuff

Some MFC stuff from CoderSource

Tuesday, January 03, 2006

A brief look at C++0x

Artima Developer

Slashdot

Monday, January 02, 2006

Visual C++ , MFC

MSDN

Revenge of the dotcom poster boy

Wired