Page 1 of 1

ayuda con Createobject()

PostPosted: Tue Apr 19, 2016 8:52 am
by mastintin
Estoy intentando manejar una tableta de firmas de wacom y en principio se puede acceder a un objeto COM que se instala, usando createobject() .
El acceso al objeto com funciona y acedo a sus propiedades y puede borrrar pantalla y demas pero ...
¿ como se crea un delegado de la funcion m_table:onPenData() ?

os pongo el codigo en javascript que ponen de ejemplo ...
Code: Select all  Expand view


   m_tablet = createObject("WacomGSS.STU.Tablet");  

   .........
   // Add the delagate that receives pen data and error.

      if (useActiveX) {
        eval("function m_tablet::onPenData(data) {return onPenData(data);}");
        eval("function m_tablet::onGetReportException(exception) {return onGetReportException(exception);}");
      } else {
        m_tablet.onPenData = onPenData;
        m_tablet.onGetReportException = onGetReportException;
      }

      // Initialize the screen
      clearScreen();

 


Gracias anticipadas.

Re: ayuda con Createobject()

PostPosted: Tue Apr 19, 2016 2:27 pm
by karinha

Re: ayuda con Createobject()

PostPosted: Tue Apr 19, 2016 4:00 pm
by mastintin

karinha , creo que no :-).
Se tendria que tratar como algo asi :

ownd:bMMoved := { || data := m_tablet:onPenData() }

Re: ayuda con Createobject()

PostPosted: Tue Apr 19, 2016 5:11 pm
by Antonio Linares
Manuel,

Como está definido onPenData en el ejemplo en javascript ?

Re: ayuda con Createobject()

PostPosted: Tue Apr 19, 2016 8:19 pm
by mastintin
Antonio , es una función , el objeto COM delega en ella la captura de datos.
Lo he resuelto usando el html dentro de un Activex a "Shell.iExplore.2" :-) , pero la duda de como seria sigue ...
Code: Select all  Expand view


  function onPenData(penData) { // Process incoming pen data
    var pt = tabletToScreen(penData);

    var btn = 0; // will be +ve if the pen is over a button.
    for (var i = 0; i < m_btns.length; ++i) {
      if (m_btns[i].Bounds.Contains(pt)) {
        btn = i + 1;
        break;
      }
    }

    var isDown = (penData.sw != 0);
   .........

 

Re: ayuda con Createobject()

PostPosted: Thu Nov 16, 2017 5:06 pm
by AngelSalom
Hola! Estoy peleándome con una wakom (stu-430) ¿lograste hacerlo funcionar?

Gracias