Club Delphi  
    FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Principal > API de Windows
Registrarse FAQ Miembros Calendario Guía de estilo Temas de Hoy

Respuesta
 
Herramientas Buscar en Tema Desplegado
  #1  
Antiguo 09-03-2005
antonioeligio antonioeligio is offline
Registrado
 
Registrado: mar 2005
Posts: 1
Poder: 0
antonioeligio Va por buen camino
Ayuda RasGetEntryProperties

en el siguiente codigo no me lee ni escriove correctamente ciertos valores de las estructura TheRasEntry , estos valores son en concreto :

TheRasEntry.dwRedialCount
TheRasEntry.dwRedialPause


, aunque si funciona

TheRasEntry.szLocalPhoneNumber,

mi codigo es el siguiente


String NombreConexion = BuscaPrimeraConexionConfigurada();
Código Delphi [-]
       // Selecciona el primer modem que encuentra
       DWORD dwLength, dwNumDispositivos;
       BYTE bDeviceInfo = NULL;
       DWORD dwDeviceInfoSize = sizeof(bDeviceInfo);
   
       // Crea o modifica una nueva conexión RAS
       RASENTRY TheRasEntry;
       ZeroMemory(&TheRasEntry, sizeof(TheRasEntry));
       LPTSTR nombre = BuscaPrimeraConexionConfigurada().c_str();
       DWORD dwEntrySize = 0;
       DWORD a =  0;
       DWORD b =  0;
   
       // No se sabe porque pero para leer los RasGetEntryProperties hay que hacer esto
   
       int j = RasGetEntryProperties(NULL,NULL,0,&a,0,0);
       int k = RasGetEntryProperties(NULL,NombreConexion.c_str(),0,&b,0,0);
       TheRasEntry.dwSize = a;
       int n = RasGetEntryProperties(NULL,NombreConexion.c_str(),&TheRasEntry,&b,0,0);
   //    if (n!=0)  loggerGsm("Error Leyendo Properties de Conexion GSM  ");
   
         if (FListaTelefonos.Length > 0)
         {
  strcpy(TheRasEntry.szLocalPhoneNumber, FListaTelefonos[0].c_str()); 
 // en principio cogeremos el primero hasta que nos enteremos como se guardan todo
         }
   
   //    TheRasEntry.ipaddr
   
         TheRasEntry.dwRedialCount = FNumeroReintentos;
  TheRasEntry.dwRedialPause = FTiempoEntreReintentos;
  // en principio cogeremos el primero hasta que nos enteremos como se guardan todos
   
       DWORD fRet;
       DWORD g = sizeof(TheRasEntry);
       fRet = RasSetEntryProperties(NULL,NombreConexion.c_str() ,&TheRasEntry, g, NULL, 0);
       if (fRet != 0)
           throw Exception("Error :: RasSetEntryProperties");
// Añade el nombre de usuario y clave a la entrada creada

Última edición por marcoszorrilla fecha: 09-03-2005 a las 15:51:03.
Responder Con Cita
Respuesta



Normas de Publicación
no Puedes crear nuevos temas
no Puedes responder a temas
no Puedes adjuntar archivos
no Puedes editar tus mensajes

El código vB está habilitado
Las caritas están habilitado
Código [IMG] está habilitado
Código HTML está deshabilitado
Saltar a Foro


La franja horaria es GMT +2. Ahora son las 21:29:43.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi
Copyright 1996-2007 Club Delphi