Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using events in BSAIntegration.dll 1

Status
Not open for further replies.

tokata

Technical User
Aug 24, 2004
18
ES
Hello,

please, could anybody tell me how to use events in Blustar integration DLL (BSAIntegration.dll) ??


I have read the "BluStar Agent Application Integration Solidus eCare" documentation, but isn`t useful, without examples.

I`m programming one application using this DLL, I can use methods, but the events doesn't work. Have anybody one example or script using events?

Thanks a lot.
 
You are using C# I presume?

just hookup the eventhandler:


Code:
...
var client = new BSAClient();
client.LaunchBSA();
client.OnCallEvent += InternalCallEventHandler;
...

InternalCallEventHandler:

private void InternalCallEventHandler(ICall call)
{
  // do something with call object
}

-----------------------------------------------------
Helping people is my job...
 
Wonderful!, It works fine!!

And now..., have you one example using javascript??, I have the same problem, methods works but no events:

JavaScript:
<html>
    <head>
		<meta charset="UTF-8">
		
		<object name="BSAClient" id="BSAClient" classid="clsid:90bfaaff-4317-4c22-ba36-c7563c03c0a2" /></object>

        <script language='JavaScript'>
				
			//Se arranca la aplicacion de BLustar
			function ejecutaBS() {				
				BSAClient.LaunchBSA();
			}
			
			
			//Se inicializa la conexion con Blustar ya arrancado
			function inicializaConexion() {
				resultadoInicializar = BSAClient.Initialize();
							
				if (resultadoInicializar)
				{
					alert("Conexion contra BSA establecida correctamente");

				}else{
					alert("Fallo en la conexion contra BSA");
				}
			}

			
			//Se cierra la conexion con BLustar
			function cerrarBS() {				
				BSAClient.CloseApplication();		
			}			

        </script>
	
		
		
		<SCRIPT LANGUAGE="javascript" FOR="BSAClient" EVENT="OnApplicationReadyForInitialization()">
		<!--
			alert("Aplicacion preparada para inicializacion");
		//-->		
		</SCRIPT>		
		
    </head>
    <body>
 
		<form name='formPrincipal'>
		
			<table border='1' width='500px' align='center'>
			<tr>
				<td>
					Ejecutar aplicación: 
				</td>
				<td>
					<input type='button' name='ejecutaBS' value='Ejecuta BS' onClick='javascript:ejecutaBS();'>
				</td>
			</tr>
			<tr>
				<td>
					Inicializar conexión : 
				</td>
				<td>
					<input type='button' name='ejecutaBS' value='Ejecuta BS' onClick='javascript:inicializaConexion();'>
				</td>
			</tr>			
			<tr>
				<td>
					Cerrar aplicación Blustar: 
				</td>
				<td>
					<input type='button' name='cerrarBS' value='Cerrar BS' onClick='javascript:cerrarBS();'>
				</td>
			</tr>			
			</table>
			
		</form>
		
    </body>
</html>

I think the event is correctly called. Whre I wrote one incorrect event name (like "thisEventDoesnExist") nothing happens, but when I write de correct event name (like the example "OnApplicationReadyForInitialization") the Internet Explorer 11 (or IE9 or IE8) gets crash. The log error es:


Firma con problemas:
Nombre del evento de problema: CLR20r3
Firma del problema 01: iexplore.exe
Firma del problema 02: 11.0.9600.17728
Firma del problema 03: 55024724
Firma del problema 04: mscorlib
Firma del problema 05: 4.0.30319.17929
Firma del problema 06: 4ffa561c
Firma del problema 07: 10d1
Firma del problema 08: 1eb
Firma del problema 09: System.Reflection.Target
Versión del sistema operativo: 6.1.7601.2.1.0.256.48
Id. de configuración regional: 3082
Información adicional 1: 0a9e
Información adicional 2: 0a9e372d3b4ad19135b953a78882e789
Información adicional 3: 0a9e
Información adicional 4: 0a9e372d3b4ad19135b953a78882e789

Lea nuestra declaración de privacidad en línea:

Si la declaración de privacidad en línea no está disponible, lea la declaración de privacidad sin conexión:
C:\Windows\system32\es-ES\erofflps.txt



Thanks a lot whosrdaddy.
 
Sadly I have to come to the same conclusion, it also crashes here.

I do use a slighty other method (but the result is the same):

Code:
        <script language='JavaScript'>
            var bsa = new ActiveXObject("Solidus.BSAIntegration.BSAClient");
            // hookup events
            eval("function bsa::OnApplicationReadyForInitialization () {return onBSAReady ();}");
            eval("function bsa::OnUserLogin () {return onBSAUserLogin ();}");
				
            function ExecuteBSA() {				
		bsa.LaunchBSA();
	    }

            function onBSAReady(){
		bsa.Initialize();
            }

	    function onBSAUserLogin(){
              var user = bsa.getUserInformation();
	          var logonId = user.LoginID; 
              alert('user '+ logonId + ' logged in');
	    }
			
			
      </script>

If you really need to do this from IE, then you will need to open a ticket on TeamTrack...

/Daddy

-----------------------------------------------------
Helping people is my job...
 
Ook!, We have open the ticket, when we hace the answer I will write here....but we now we can wait several weeks.


Thanks a lot whosrdaddy.
 
Sure let me know, I am interested too :)

-----------------------------------------------------
Helping people is my job...
 
Hi whosrdaddy,

this is the solution:


Following is the conclusion we reached on the reason for this crash:
The OnApplicationReadyForInitialization event is going to get invoked twice when the LaunchBSA method is called. First, it will invoke it on the same thread. Then, it will invoke it after the BSA is launched on a different thread.IE is crashing when this event is called on different thread.

As a workaround for this issue , Open a CMD prompt and run the following command. You may need to change the path to the BSAIntegration.dll if it’s installed in a different place.

C:\Windows\Microsoft.NET\Framework\v4.0.30319\regasm "C:\Program Files (x86)\Aastra\Solidus eCare\Applications\Bin\BSAIntegration.dll" /codebase /tlb


You must execute this command in all Blustar Clients.


And with this code:

Code:
<head>
	<object name="BSAClient" id="BSAClient" classid="clsid:90bfaaff-4317-4c22-ba36-c7563c03c0a2" /></object>
	
	<script  ID="ClientEventHandlersJS"  language='JavaScript'>
	<!--	
		BSAClient.LaunchBSA();
	-->
	</script>

	
	
	<SCRIPT LANGUAGE="javascript" FOR="BSAClient" EVENT="OnApplicationReadyForInitialization()">
	<!--
		alert("Aplicacion preparada para inicializacion");
	//-->		
	</SCRIPT>

</head>


All is working fine now.

I hope this will be helpful for you :)
 
Hi Tokata,

thank you very much for your feedback, very helpful info indeed [2thumbsup]!

Cheers,
Daddy

-----------------------------------------------------
Helping people is my job...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top