![]() |
Модераторы: Daevaorn |
![]() ![]() ![]() |
|
Sasqatch |
|
||||
Unregistered |
I'm sure that is very simple problem but i'm only beginner in C++, so i'll be very thankful for any advice.
I have some functions that manadge passing variables from JS to C and back and need convert JavaScript string to C/C++ char * data type (path to a file). There is the special function JS_ValueToString which gets JS value (js string) convert it and returns a pointer that points to a null-terminated string. So a past several days i'm trying apply JavaScript programming knowledge but with no success ![]() Below is the code i'm trying to finish:
Just in case here is JS_ValueToString explanation from docs:
THANK YOU FOR ANY ADVICE! |
||||
|
|||||
Дрон |
|
|||
![]() Java-ненавистник :) ![]() ![]() ![]() ![]() Профиль Группа: Участник Клуба Сообщений: 3179 Регистрация: 29.12.2002 Где: Санкт-Петербург Репутация: 10 Всего: 92 |
It looks strange that JS_ValueToString() function returns unsigned short* instead of char*. Are you sure that it doesn't return a unicode string?
In fact I've never worked with JS but I suppose this code should work correctly:
![]() Это сообщение отредактировал(а) Дрон - 31.7.2004, 21:44 -------------------- Да. Именно так. |
|||
|
||||
![]() ![]() ![]() |
Правила форума "С++:Общие вопросы" | |
|
Добро пожаловать!
Если Вам понравилась атмосфера форума, заходите к нам чаще! С уважением, Earnest Daevaorn |
0 Пользователей читают эту тему (0 Гостей и 0 Скрытых Пользователей) | |
0 Пользователей: | |
« Предыдущая тема | C/C++: Общие вопросы | Следующая тема » |
|
По вопросам размещения рекламы пишите на vladimir(sobaka)vingrad.ru
Отказ от ответственности Powered by Invision Power Board(R) 1.3 © 2003 IPS, Inc. |