[C++-sig] python call C++'s unicode functions?

Raul ro4tub at gmail.com
Sun Mar 19 12:12:10 CET 2006


void Foo(LPCWSTR str)
{
 MessageBoxW(NULL,str,L"Info",MB_OK);
}

BOOST_PYTHON_MODULE(dxui)
{
 def("Foo",Foo);
}

and i want to call the C++ function 'Foo' in the python scripts like that:
#Python Scripts
def Bar():
   Foo(u"Hello World");

and then i call the Python Function 'Bar' in the C++ source file.

but i don't know how to conver the python 'unicode' type to LPCWSTR  (the
same as
const unsigned short *).
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/cplusplus-sig/attachments/20060319/9f1a005c/attachment.htm>


More information about the Cplusplus-sig mailing list