Showing posts with label mfc. Show all posts
Showing posts with label mfc. Show all posts

2006-07-25

MFC vs WinForms vs SWT

All that you need to know to embed an Office application into:

MFC
http://www.rsdn.ru/article/com/xoffice.xml and http://www.rsdn.ru/article/com/autoatl.xml
two articles in about 10-12 pages - beat in a drum to adjust a project


WinForms
http://blogs.gotdotnet.ru/personal/k_savelev/PermaLink.aspx?guid=6d39ad7d-d1ae-4daf-8ce2-9b881ca7091a
A heap of links, ready external component and therefore a little headache when installing application to client


SWT
http://www.java2s.com/Code/Java/SWT-JFace-Eclipse/WordOLE.htm
a couple strings of code and everithing works from the box

2006-06-13

CPPUnit Addon

I had to dig CPPUnit a little to have a possibility to inspect values of MFC CString in case of test failure.

#include <cppunit/TestAssert.h>

CPPUNIT_NS_BEGIN
// specialization for the CString type
template<>
struct assertion_traits<CString>
{
static bool equal( const CString& x, const CString& y )
{
return x == y;
}

static std::string toString( const CString& x )
{
// adds quote around the string to see whitespace
OStringStream ost;
ost << "\""<<(LPCSTR)x<<"\"";
return ost.str();;
}
};
CPPUNIT_NS_END


When I'll have enough time I'll readjust CompilerOutputter a little to have nice green and red lines in the console :)

2006-05-10

The programming: MFC nonsense

Nonsense:

This does not work:
combo.SetRedraw(FALSE);
//Blah-blah-blah
combo.SetWindowText("something not in list");
combo.SetRedraw(TRUE);


And this works:
combo.SetRedraw(FALSE);
//Blah-blah-blah
combo.SetRedraw(TRUE);
combo.SetWindowText("something not in list");

Sucks...