ayuda con Createobject()

ayuda con Createobject()

Postby mastintin » Tue Apr 19, 2016 8:52 am

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.
User avatar
mastintin
 
Posts: 1516
Joined: Thu May 27, 2010 2:06 pm

Re: ayuda con Createobject()

Postby karinha » Tue Apr 19, 2016 2:27 pm

João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7154
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: ayuda con Createobject()

Postby mastintin » Tue Apr 19, 2016 4:00 pm


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

ownd:bMMoved := { || data := m_tablet:onPenData() }
User avatar
mastintin
 
Posts: 1516
Joined: Thu May 27, 2010 2:06 pm

Re: ayuda con Createobject()

Postby Antonio Linares » Tue Apr 19, 2016 5:11 pm

Manuel,

Como está definido onPenData en el ejemplo en javascript ?
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41206
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: ayuda con Createobject()

Postby mastintin » Tue Apr 19, 2016 8:19 pm

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);
   .........

 
User avatar
mastintin
 
Posts: 1516
Joined: Thu May 27, 2010 2:06 pm

Re: ayuda con Createobject()

Postby AngelSalom » Thu Nov 16, 2017 5:06 pm

Hola! Estoy peleándome con una wakom (stu-430) ¿lograste hacerlo funcionar?

Gracias
Angel Salom
Visionwin Software - https://www.visionwin.com
------------------------------------------------------------
fwh 19.05 - harbour 3.2 - bcc 7.4
User avatar
AngelSalom
 
Posts: 708
Joined: Fri Oct 07, 2005 7:38 am
Location: Benicarló (Castellón ) - España


Return to FiveWin para Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 7 guests