Hello,

Sorry for my poor english. I obtain this under Windows / PHP-GTK :

CODE


C:php4>php4.exe SKYPE_PHPGTK.php



Warning: (null)(): Invoke() failed: Exception occurred.

<b>Source</b>: SkypeAPI.Access.1 <b>Description</b>: Unexpected results after sending message in C:php4SKYPE_PHPGTK.php on line 21



C:php4>




This is my code :

CODE


#!/usr/bin/php -q

<?php

if (!class_exists('gtk'))

{

   dl('php_gtk.'.(strstr(PHP_OS, 'WIN') ? 'dll' : 'so'));    

}



function get_input($entry) {}



function send_message($gethandle,$getmessage)

{

   $com = new COM("SKYPEAPI.Access") or die("can not create SKYPEAPILib.Access object");



   $com->Connect();

   sleep(5);

   

   if((strlen($gethandle))==0 || (strlen($getmessage))==0)

   {

   }else

   {

$com->SendMessage($gethandle, $getmessage);

   }

}



//Nouvelle instance d'une fenêtre

$w=&new GtkWindow();

//Connection pour pouvoir quitter proprement

$w->connect_object('destroy',array("gtk","main_quit"));

//Titre de notre fenêtre

$w->set_title("PHP-GTK - Test des API de SKYPE");

//Dimension

$w->set_default_size(500,150);

//Position centrée

$w->set_position(GTK_WIN_POS_CENTER);



$box = &new GtkVBox();

$w->add($box);

$lbl1 = &new GtkLabel();

$lbl1->set_text("A :");

$box->add($lbl1);

$entry1 = &new GtkEntry();

$entry1->grab_focus();

$entry1->set_text("xavierl2962");

$entry1->connect('activate', 'get_input');

$box->add($entry1);



$lbl2 = &new GtkLabel();

$lbl2->set_text("Message:");

$box->add($lbl2);

$entry2 = &new GtkEntry();

$entry2->set_text("Ceci est un essai");

$entry2->connect('activate', 'get_input');

$box->add($entry2);



$button1 = &new GtkButton('Envoyer le message');

$button1->connect_object('clicked', 'send_message',$entry1->get_text(),$entry2->get_text());

$box->add($button1);

$box->show_all();

//Affiche tout

$w->show_all();

//gtk main

Gtk::main();

?>






Why this error ?

Xavier