powered by simpleCommunicator - 2.0.59     © 2026 Programmizd 02
Целевая тема:
Создать новую тему:
Автор:
Закрыть
Цитировать
Форумы / ASP.NET [игнор отключен] [закрыт для гостей] / есть COM-Object на С++ и клиент JavaScript
2 сообщений из 2, страница 1 из 1
есть COM-Object на С++ и клиент JavaScript
    #32860753
DJStealth
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Гость
есть COM-Object на С++ и клиент JavaScript
в COM-объекте есть функция у которой есть out параметр
как сделать так чтобы клиент на JavaScript понял этот параметр?

Код: plaintext
1.
2.
var iCount =  0 ;
oMsngrObj.GetCountBuddiesList( iCount );
alert( iCount );


iCount остается 0 хотя в СОМ обекте он принял какое-то значение
------
Пр(CTime::GetCurrentTime()) ? (о) : (и)шло время спать
...
Рейтинг: 0 / 0
есть COM-Object на С++ и клиент JavaScript
    #32871091
OstapBender
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Гость
Some C++ programmers expect JavaScript to support passing parameters by reference. When we pass a parameter by reference, we pass the address of the parameter instead of its value. Once inside the function, we can change the stored value in this address. If JavaScript would have supported passing by reference, the following script would have resulted in an alert box showing the value of 6 (3 is passed to the function change() where it is doubled):

<SCRIPT LANGUAGE="JavaScript">
var a = 3;
change(a);
alert(a);

function change(value) {
value = value * 2;
}

</SCRIPT>
But JavaScript does not support passing by reference. It passes its parameters by value only. A function does not have any way to know the address of its parameters, and hence cannot change the stored parameter value. The script above generates an alert box with the value of 3, as the variable a is not being changed by the function change().
...
Рейтинг: 0 / 0
2 сообщений из 2, страница 1 из 1
Форумы / ASP.NET [игнор отключен] [закрыт для гостей] / есть COM-Object на С++ и клиент JavaScript
Найденые пользователи ...
Разблокировать пользователей ...
Читали форум (0):
Пользователи онлайн (0):
x
x
Закрыть


Просмотр
0 / 0
Close
Debug Console [Select Text]