|
// SimpleDynCreate.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include "ClassFactory.h"
#include "SampleBase.h"
int _tmain(int argc, TCHAR* argv[])
{
CSampleBase* pBase = NULL;
TCHAR tcStringToTranslate[] = _T("One or two tiers ?");
// print starting status
std::cout << tcStringToTranslate << std::endl;
TCHAR tcsDelimits[] = _T(" ");
TCHAR * tcToken = _tcstok(tcStringToTranslate, tcsDelimits);
while (tcToken)
{
pBase = CClassFactory< TCHAR*, CSampleBase, _tcsless >::CreateInstance(tcToken);
if (pBase)
{
std::cout << pBase->Display();
delete pBase;
}
else
{
std::cout << tcToken;
}
std::cout << _T(" ");
tcToken = _tcstok(NULL, tcsDelimits);
}
std::cout << std::endl;
return 0;
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.