Club Delphi  
    Paypal   FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Otros entornos y lenguajes > C++ Builder
Registrarse FAQ Miembros Calendario Guía de estilo Temas de Hoy

Respuesta
 
Herramientas Buscar en Tema Desplegado
  #1  
Antiguo 19-06-2025
navbuoy navbuoy is offline
Miembro
 
Registrado: mar 2024
Posts: 360
Poder: 3
navbuoy Va por buen camino
Talking Snaked Library 1.0

Código:
#ifndef SNAKEDLIBRARY_H
#define SNAKEDLIBRARY_H

#ifdef __cplusplus
extern "C" {
#endif

// Funciones exportadas
__declspec(dllimport) bool IsValidEmail(const char* email);
__declspec(dllimport) const char* GetCurrentDateTime();
__declspec(dllimport) int CalculateAge(const char* birth);
__declspec(dllimport) const char* ToUpperCase(const char* text);
__declspec(dllimport) const char* GenerateUUID();
__declspec(dllimport) int WordCount(const char* text);
__declspec(dllimport) void StartTimer();
__declspec(dllimport) double StopTimer();
__declspec(dllimport) void MicroDelay(long MicroSecs);
__declspec(dllimport) void ScreenShot(char*BmpName);
__declspec(dllimport) const char* PassHash(const char* passwd, int encoding);
__declspec(dllimport) const char* PT_Element(AnsiString Command);

#ifdef __cplusplus
}
#endif

#endif // SNAKEDLIBRARY_H
Estoy haciendo una libreria DLL con funciones propias

Pronto os pasare algo para que la probéis



os paso un capture de lo que voy haciendo:


Última edición por navbuoy fecha: 19-06-2025 a las 04:30:31.
Responder Con Cita
  #2  
Antiguo 19-06-2025
Avatar de Neftali [Germán.Estévez]
Neftali [Germán.Estévez] Neftali [Germán.Estévez] is offline
[becario]
 
Registrado: jul 2004
Ubicación: Barcelona - España
Posts: 19.435
Poder: 10
Neftali [Germán.Estévez] Es un diamante en brutoNeftali [Germán.Estévez] Es un diamante en brutoNeftali [Germán.Estévez] Es un diamante en bruto
__________________
Germán Estévez => Web/Blog
Guía de estilo, Guía alternativa
Utiliza TAG's en tus mensajes.
Contactar con el Clubdelphi

P.D: Más tiempo dedicado a la pregunta=Mejores respuestas.
Responder Con Cita
  #3  
Antiguo 19-06-2025
navbuoy navbuoy is offline
Miembro
 
Registrado: mar 2024
Posts: 360
Poder: 3
navbuoy Va por buen camino
He añadido algunas funciones mas:

Cita:
////////////////////////////////////////////////
// Using the function MicroDelay()
////////////////////////////////////////////////

void MilliDelay (long MilliSecs)
{
MicroDelay (MilliSecs * 1000);
}

////////////////////////////////////////////////


////////////////////////////////////////////////
// Using the function ScreenShot()
////////////////////////////////////////////////

AnsiString FILE_CAPTURE = "example.bmp";

ScreenShot(FILE_CAPTURE.c_str());

////////////////////////////////////////////////

////////////////////////////////////////////////
// Using the function SwitchGraphicMode()
////////////////////////////////////////////////

void __fastcall TForm1::Button1Click(TObject *Sender)
{
if (SwitchGraphicMode(1280, 720, 32))
ShowMessage("Graphic Mode switched OK.");
else
ShowMessage("Error switching Graphic Mode, perhaps this mode not supported.");

ChangeDisplaySettings(NULL, 0); // Back Desktop mode by default
}

////////////////////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////
// Using the function PlayWAV()
////////////////////////////////////////////////

void __fastcall TForm1::Button1Click(TObject *Sender)
{
PlayWAV("C:\\Sonidos\\disparo.wav");
PlaySound(NULL, 0, 0); // STOP the current sound
}

////////////////////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////
// Using the function trim()
////////////////////////////////////////////////


void __fastcall TForm1::Button1Click(TObject *Sender)
{
char buffer[] = " texto con espacios ";
char* resultado = trim(buffer);
ShowMessage(AnsiString("Resultado: '") + resultado + "'");
}

Código:
#ifndef SNAKEDLIBRARY_H
#define SNAKEDLIBRARY_H

#ifdef __cplusplus
extern "C" {
#endif

// Funciones exportadas
// Elimina espacios al principio y final de una cadena
__declspec(dllimport) char* trim(char* str);

// Invierte una cadena
__declspec(dllimport) void reverse(char* str);

// Devuelve true (1) si la cadena es numérica
__declspec(dllimport) int isNumeric(const char* str);

// Convierte toda la cadena a minúsculas
__declspec(dllimport) void toLower(char* str);

// Reproduce Fichero de sonido WAV
__declspec(dllimport) void PlayWAV(const char* ruta);

// Cambia Modo Grafico del PC
__declspec(dllimport) bool SwitchGraphicMode(int width, int height, int bpp);

// Valida el E-Mail
__declspec(dllimport) bool IsValidEmail(const char* email);

// Obtiene Fecha/Hora Actual
__declspec(dllimport) const char* GetCurrentDateTime();

// Calcula una Edad con la fecha de nacimiento
__declspec(dllimport) int CalculateAge(const char* birth);

// Pone todo en MAYUSCULAS
__declspec(dllimport) const char* ToUpperCase(const char* text);

// Generar el UUID
__declspec(dllimport) const char* GenerateUUID();

// Cuenta el numero de palabras en el texto
__declspec(dllimport) int WordCount(const char* text);

// Timer de Tiempo "elapsed" inicia el contador
__declspec(dllimport) void StartTimer();

// Timer de Tiempo "elapsed" detiene el contador
__declspec(dllimport) double StopTimer();

// Funcion de DELAY de MicroSegundos
__declspec(dllimport) void MicroDelay(long MicroSecs);

// Capturador de PANTALLA del PC (archivo BMP)
__declspec(dllimport) void ScreenShot(char*BmpName);

// Encripta un Password con SHA
__declspec(dllimport) const char* PassHash(const char* passwd, int encoding);

// Obtiene informacion de la TABLA PERIODICA DE ELEMENTOS
__declspec(dllimport) const char* PT_Element(AnsiString Command);

#ifdef __cplusplus
}
#endif

Última edición por navbuoy fecha: 19-06-2025 a las 17:10:35.
Responder Con Cita
  #4  
Antiguo 20-06-2025
navbuoy navbuoy is offline
Miembro
 
Registrado: mar 2024
Posts: 360
Poder: 3
navbuoy Va por buen camino
de momento ya llevo esto hecho:

Código:
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Functions in Snaked Library 1.0
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void bubble_sort( int a[], int n );

DESCRIPTION: this function sort a array of int elements 
IN: array of int numbers - number of elements
RETURN: nothing
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
char* trim(char* str);
DESCRIPTION: This function erase the spaces into the string
IN: char* string
RETURN: char* string trimmed (erase spaces)
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
char* reverse(char* str);
DESCRIPTION: This function reverse the string
IN: char* string
RETURN: the same string but reversed
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
int isNumeric(const char* str);
DESCRIPTION: This function say us if the string is numeric
IN: char* string
RETURN: int value (0 - No valid number  1 - Valid numeric string)
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 
void toLower(char* str);
DESCRIPTION: This function change the characters to lowercase
IN: char* string
RETURN: nothing
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void PlayWAV(const char* ruta);
DESCRIPTION: This function play a WAV sound file using PlaySound Windows API func
IN: char* string with path and wav file
RETURN: nothing
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
bool SwitchGraphicMode(int width, int height, int bpp, int frequency);
DESCRIPTION: This function switch the Graphic Mode in the Desktop
IN: int width - int height - int bpp (bits per pixel) - int frequency
RETURN: int value (0 - Success -  other values - Error)
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void SaveOriginalGraphicMode()
DESCRIPTION: This function save the current Graphic Mode of the machine
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void RestoreOriginalGraphicMode()
DESCRIPTION: This function restore the original graphic mode previously saved
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////


//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
bool IsValidEmail(const char* email);
DESCRIPTION: This function validate a correct email address
IN: char* string with email 
RETURN: int value (1 (True) - Success -  0 (False) - Error)

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
const char* GetCurrentDateTime();
DESCRIPTION: This function returns the current Date/Time information
IN: Nothing
RETURN: const char* string with information of Date/Time
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
int CalculateAge(const char* birth);
DESCRIPTION: This function calculate the AGE from a birth Date
IN: const char* string with Date
RETURN: int value with Age 
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
const char* ToUpperCase(const char* text);
DESCRIPTION: This function change the string to UpperCase characters
IN: const char* text
RETURN: const char* with converted to UpperCase string
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
const char* GenerateUUID();
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
int WordCount(const char* text);
DESCRIPTION: This function count words in a given text
IN: const char* string (text)
RETURN: int value (Num of Words)
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void StartTimer();
DESCRIPTION: This function start a internal elapsed time meter
IN: nothing
RETURN: nothing
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
double StopTimer();
DESCRIPTION: Stop the elapsed time meter and return time elapsed in Milliseconds
IN: nothing
RETURN: double value (Milliseconds)
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void MicroDelay(long MicroSecs);
DESCRIPTION: This function make a Delay pause in MicroSecs
IN: long Microseconds
RETURN: Nothing
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void ScreenShot(char*BmpName)
DESCRIPTION: This function make a screen capture of the Desktop in BMP format
IN: char* string with bitmap filename (ended in .bmp)
RETURN: Nothing, just make the screenshot and write it in disk
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
const char* PassHash(const char* passwd, int encoding);
DESCRIPTION: This function Encode a text string to a SHA encoded hashed password
IN: const char* passwd - int encoding (0) SHA224 - (1) SHA256 - (2) SHA384 - (3) SHA512

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
const char* PT_Element(AnsiString Command);
DESCRIPTION: This function return information of the element of Periodic Table
IN: AnsiString Command (can be the numeric number of element, or name or element or formulation name)
RETURN: const char* with desired information

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

Última edición por navbuoy fecha: 20-06-2025 a las 12:08:11.
Responder Con Cita
  #5  
Antiguo 21-06-2025
navbuoy navbuoy is offline
Miembro
 
Registrado: mar 2024
Posts: 360
Poder: 3
navbuoy Va por buen camino
Responder Con Cita
  #6  
Antiguo 21-06-2025
navbuoy navbuoy is offline
Miembro
 
Registrado: mar 2024
Posts: 360
Poder: 3
navbuoy Va por buen camino
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

Temas Similares
Tema Autor Foro Respuestas Último mensaje
Stardust by Snaked & Joe - Web Oficial navbuoy Noticias 2 20-10-2024 07:58:19
Para imprimir PDF: Free PDF Library for Delphi Developers - Quick PDF Library LITE rrf Varios 5 26-04-2019 18:30:17
Library Path en FPC de iOS kotai FireMonkey 5 18-06-2012 12:34:52
Db-library network chavito_123 Varios 0 08-08-2007 05:09:43


La franja horaria es GMT +2. Ahora son las 05:49:28.


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