SOL9 2.0 Sample: Hello

SOL9 2.0 Samples

1 Screenshot


2 Source code

/*
 * Hello.cpp 
 * Copyright (c) 2009 Antillia.com TOSHIYUKI ARAI. ALL RIGHTS RESERVED. 
 */



#include <sol/Object.h>
#include <sol/String.h>

namespace SOL {

class Hello :public Object {

private:
    String string;
public:
    Hello(const TCHAR* message)
    :string(message) 
    {

    }

public:
    void display()
    {
        _tprintf(_T("%s\n"), (const TCHAR*)string);
    }
};

}

void _tmain(int argc, TCHAR** argv)
{
    //At first, not explicitly defined a locale    
    String hello = _T("Hello World. こんにちは世界");  //wchar_t string in UNICODE environment. 

    Hello helloWorld(hello);
    
    helloWorld.display();

    //Next, call _tsetlocale. 
    _tsetlocale(LC_ALL, _T(""));

    helloWorld.display();

}

Last modified: 11 Nov 2009

Copyright (c) 2009 Antillia.com ALL RIGHTS RESERVED.