Language: ChineseGermanSpanishFrenchDutchItalianRussian
123 Flash Chat Forums

Go Back   TOPCMM Community > SWFKit > SWFKit Support

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 12-28-2007, 06:42 AM
Junior Member
 
Join Date: Jan 2006
Posts: 16
Default Activex Event problem

dear sir;
I meet a ActiveX Event problem, please give some guide.

The API Documentation :
OnTalkInvited event
--------------------------------------------------------------------------------
Declaration

OnTalkInvited( ByVal aHandle As Long ,ByRef aOkay As Boolean )

Description

OnTalkInvited event notifies about a talk request from a peer. The application should display a prompt to the user asking for a permission.

Parameters

aHandle Handle of the peer object firing the event.
aOkay If the user wants to accept the call, this parameter must be set to True
------------------------------------------------------------------------------

Delphi sample code:

procedure TfMain.GoTalkInvited(Sender: TObject; aHandle: Integer; var Ok: Wordbool);
var
Pr: TPeer;
begin
Pr := TPeer(VoiCln.GetMoniker(aHandle));
if Pr = nil then Exit;
LogMsg('Call is requested from ' + UN(Pr.Username));
sndPlaySound('C:\Windows\Media\ringout.wav', SND_NODEFAULT);
sndPlaySound('C:\Windows\Media\ringout.wav', SND_NODEFAULT Or SND_ASYNC);
SetForegroundWindow(Handle);
fAccept.Peer := Pr;
if fAccept.ShowModal <> mrOk then Exit;
Ok := True;
end;

my code:

VoiCln.activex.OnTalkInvited=function(aHandle,aOka y)
{
var ret = Dialogs.msgBox("Please choose", "Ok or Cancel", 1);
if (ret == 1)
{
aOkay=true;
}
else
{
aOkay=false;
}
}

but, it's wrong, other methods and events are ok.

Reply With Quote
  #2 (permalink)  
Old 12-28-2007, 06:46 AM
Junior Member
 
Join Date: Jan 2006
Posts: 16
Default Re: Activex Event problem

BTW:
result of trace(aOkay) is [object Object].
Reply With Quote
  #3 (permalink)  
Old 12-28-2007, 07:49 AM
Senior Member
 
Join Date: Dec 2002
Posts: 2,015
Default Re: Activex Event problem

Javascript does not support arguments of "byref" type. However, swfkit has a way to deal with "byref" arguments of an ActiveXObject event, which is, if an argument is byref, it will be converted to an object, and then you can get or set its value with the "value" property of the object.

Code:
trace(aOkay.value);
aOkay.value = true;
Reply With Quote
  #4 (permalink)  
Old 12-29-2007, 03:42 PM
Junior Member
 
Join Date: Jan 2006
Posts: 16
Default Re: Activex Event problem

it's ok,thank you response.
Reply With Quote
Reply

Was this information helpful?    Yes No



Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 04:44 AM.


Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0 ©2007, Crawlability, Inc.