elhacker.net cabecera Bienvenido(a), Visitante. Por favor Ingresar o Registrarse
¿Perdiste tu email de activación?.
 
Inicio Ayuda Ingresar Registrarse
30 Agosto 2008, 09:11  



+  Foro de elhacker.net
|-+  Seguridad Informática
| |-+  Hacking Avanzado
| | |-+  Hacking Mobile
| | | |-+  eVC++ Serial Port ISSUE
0 Usuarios y 1 Visitante están viendo este tema.
Páginas: [1] Ir Abajo Imprimir
Autor Tema: eVC++ Serial Port ISSUE  (Leído 290 veces)
hoofmen

Desconectado Desconectado

Mensajes: 12


Ver Perfil
eVC++ Serial Port ISSUE
« en: 03 Mayo 2006, 00:01 »

Saludos, estoy muy interesado en hacer una aplicacion como la que veran en el siguiente link:
http://channel9.msdn.com/ShowPost.aspx?PostID=42234
Se trata de una aplicacion Smartphone (wm5.0) escrita en eVC++ que se conecta por serial port hasta el laptop para controlar power point, dado que el autor de esta aplicacion trabaja en microsoft, es muy esquivo cuando le preguntan por el source, entonces quiero hacer una version propia y con mas utilidades (mover el mouse ejemplo, y hacer click!) y dejar a disposicion de todos aquellos que estan rogandole al M$ employee por unos tips de como construyo su app.

saludos:

pd esto llevo como app cliente desde la PPC (y funciona):
Código:

#include <windows.h>
#include <stdio.h>

HANDLE fileHandle;

int OpenSerialPort();
int CloseSerialPort();
int SendMsg();

int OpenSerialPort()
{
   if (fileHandle == NULL){
      fileHandle = CreateFile(_T("COM7:"),          GENERIC_WRITE ,0,NULL,OPEN_EXISTING,0,0);
      if (fileHandle == INVALID_HANDLE_VALUE){
         MessageBox(NULL,L"No se pudo crear el COM 7",L"Aviso",MB_OK);
         fileHandle = NULL;
         return 0;
      }
   }
   return 1;
}

int CloseSerialPort()
{
   if (fileHandle != NULL){
      CloseHandle(fileHandle);
      fileHandle = NULL;
      MessageBox(NULL,L"COM cerrado",L"Aviso",MB_OK);
      return 1;
   }
   return 0;
}

int SendMsg()
{
   DWORD dwSize = 0, dwWritten = 0;
   const int key = 13;

   WriteFile(fileHandle, &key, sizeof(key), &dwWritten, NULL);
   MessageBox(NULL,L"Mensaje Enviado",L"Aviso",MB_OK);
   return 1;
}

int main (int argc, char** argv)
{
   if (!OpenSerialPort())
      return -1;

   SendMsg();

   if (!CloseSerialPort())
      return -1;

   return 1;
}
 

la idea es enviar el numero 13 y recivirlo desde el pc..y esa es la parte que no se me ocurre, tendre que crear un formato de paquetes a recivir en el lado del Laptop?

saludos y gracias nuevamente
En línea
Páginas: [1] Ir Arriba Imprimir 
Ir a:  





Consolas     La Web de Goku     MilW0rm     MundoDivx

Hispabyte     Truzone     TodoReviews     ZonaPhotoshop

hard-h2o modding    Foros de ayuda    Yashira.org    Videojuegos    indetectables.net   

Noticias Informatica    Seguridad Informática    ADSL    Foros en español    eNYe Sec

Todas las webs afiliadas están libres de publicidad engañosa.

Powered by SMF 1.1.5 | SMF © 2006-2008, Simple Machines LLC