En la clase TInternet, el método ::GetErrorDescription(),
como hacer para que los mensajes de error los presente en castellano?
In order for this site to work correctly we need to store a small file (called a cookie) on your computer. Most every site in the world does this, however since the 25th of May 2011, by law we have to get your permission first. Please abandon the forum if you disagree.
Para que este foro funcione correctamente es necesario guardar un pequeño fichero (llamado cookie) en su ordenador. La mayoría de los sitios de Internet lo hacen, no obstante desde el 25 de Marzo de 2011 y por ley, necesitamos de su permiso con antelación. Abandone este foro si no está conforme.
Para que este foro funcione correctamente es necesario guardar un pequeño fichero (llamado cookie) en su ordenador. La mayoría de los sitios de Internet lo hacen, no obstante desde el 25 de Marzo de 2011 y por ley, necesitamos de su permiso con antelación. Abandone este foro si no está conforme.
Clase TInternet. Mensajes en castellano
- josemanuel
- Mensajes: 14
- Registrado: Mié Oct 28, 2015 8:05 am
- ignacio
- Site Admin
- Mensajes: 9254
- Registrado: Lun Abr 06, 2015 8:00 pm
- Ubicación: Madrid, Spain
- Contactar:
Re: Clase TInternet. Mensajes en castellano
Buenos días,
No creo que funcione, pero cambia esta función en Internet.prg:
HB_FUNC_STATIC( XINTERNET_GETERRORDESCRIPTION )
{
PHB_ITEM Self = hb_stackSelfItem();
DWORD dwError = HB_ISNUM( 1 ) ? hb_parnl( 1 ) : XA_ObjGetNL( Self, "nLastError" );
if( ! ( dwError == ERROR_INTERNET_EXTENDED_ERROR ) )
{
HMODULE hModule = GetModuleHandle( "wininet.dll" );
char * szBuffer = hb_xgrab( 1024 );
if( FormatMessage( FORMAT_MESSAGE_IGNORE_INSERTS |
FORMAT_MESSAGE_FROM_HMODULE,
hModule, dwError,
MAKELANGID( LANG_SYSTEM_DEFAULT, SUBLANG_DEFAULT ),
(LPTSTR) szBuffer, 1023, NULL ) )
hb_retc( szBuffer );
else
hb_retc( "" );
hb_xfree( szBuffer );
}
else
{
LPTSTR lpBuffer;
DWORD dwErr;
DWORD dwLen = 0;
InternetGetLastResponseInfo( &dwErr, NULL, &dwLen );
if( dwLen )
{
lpBuffer = hb_xgrab( ( dwLen + 1 ) * sizeof( TCHAR ) );
InternetGetLastResponseInfo( &dwErr, lpBuffer, &dwLen );
hb_retc( lpBuffer );
hb_xfree( lpBuffer );
}
else
hb_retc( "" );
}
}
No creo que funcione, pero cambia esta función en Internet.prg:
HB_FUNC_STATIC( XINTERNET_GETERRORDESCRIPTION )
{
PHB_ITEM Self = hb_stackSelfItem();
DWORD dwError = HB_ISNUM( 1 ) ? hb_parnl( 1 ) : XA_ObjGetNL( Self, "nLastError" );
if( ! ( dwError == ERROR_INTERNET_EXTENDED_ERROR ) )
{
HMODULE hModule = GetModuleHandle( "wininet.dll" );
char * szBuffer = hb_xgrab( 1024 );
if( FormatMessage( FORMAT_MESSAGE_IGNORE_INSERTS |
FORMAT_MESSAGE_FROM_HMODULE,
hModule, dwError,
MAKELANGID( LANG_SYSTEM_DEFAULT, SUBLANG_DEFAULT ),
(LPTSTR) szBuffer, 1023, NULL ) )
hb_retc( szBuffer );
else
hb_retc( "" );
hb_xfree( szBuffer );
}
else
{
LPTSTR lpBuffer;
DWORD dwErr;
DWORD dwLen = 0;
InternetGetLastResponseInfo( &dwErr, NULL, &dwLen );
if( dwLen )
{
lpBuffer = hb_xgrab( ( dwLen + 1 ) * sizeof( TCHAR ) );
InternetGetLastResponseInfo( &dwErr, lpBuffer, &dwLen );
hb_retc( lpBuffer );
hb_xfree( lpBuffer );
}
else
hb_retc( "" );
}
}
- josemanuel
- Mensajes: 14
- Registrado: Mié Oct 28, 2015 8:05 am
Re: Clase TInternet. Mensajes en castellano
No funciona
- ignacio
- Site Admin
- Mensajes: 9254
- Registrado: Lun Abr 06, 2015 8:00 pm
- Ubicación: Madrid, Spain
- Contactar:
Re: Clase TInternet. Mensajes en castellano
Hola,
Me lo temía. Poco más se puede hacer. Lo siento.
Un saludo
Me lo temía. Poco más se puede hacer. Lo siento.
Un saludo