1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
|
PHP_FUNCTION(printer_draw_text)
{
zval **arg1, **arg2, **arg3, **arg4;
printer *resource;
LPCWSTR str;
wchar_t * wstr2;
if( zend_get_parameters_ex(4, &arg1, &arg2, &arg3, &arg4) == FAILURE ) {
WRONG_PARAM_COUNT;
}
ZEND_FETCH_RESOURCE(resource, printer *, arg1, -1, "Printer Handle", le_printer);
convert_to_string_ex(arg2);
convert_to_long_ex(arg3);
convert_to_long_ex(arg4);
wstr2 = (wchar_t*)(Z_STRVAL_PP(arg2)); //arg2 is the 你好 string that I pass to
//ExtTextOut(resource->dc, Z_LVAL_PP(arg3), Z_LVAL_PP(arg4), ETO_OPAQUE, NULL, Z_STRVAL_PP(arg2), Z_STRLEN_PP(arg2), NULL); //This is the original line
ExtTextOutW(resource->dc, Z_LVAL_PP(arg3), Z_LVAL_PP(arg4), ETO_OPAQUE, NULL, wstr2 , wcslen (wstr2), NULL); //This is my version
}
|