#include "mensajes.h" #include "funVarias.h" #include void mostrarMsj(std::string opcion, std::string titulo, std::string texto) { int TamText = texto.size(); //Obtenemos el tamaño del texto q keremos mostrar int TamTitle = titulo.size(); //Lo mismo para el tamaño del titulo //La funcion MessageBox no nos deja mostrar una cadena, por lo que la debemos pasar a char char* mens = new char [TamText]; //Esta es la matriz q se mostrará char* title = new char [TamTitle]; //Idem para el titulo StrToChar(texto, mens); StrToChar(titulo, title); //mostramos el mensaje, segun la opcion elegida if (opcion == "error"){ MessageBox(NULL,mens,title,MB_ICONERROR); //ERROR } if (opcion == "info"){ MessageBox(NULL,mens,title,MB_ICONINFORMATION); //INFORMACION } if (opcion == "interrog"){ MessageBox(NULL,mens,title,MB_ICONQUESTION); //INTERROGACION } if (opcion == "adver"){ MessageBox(NULL,mens,title,MB_ICONEXCLAMATION); //ADVERTENCIA } delete mens; //Liberamos la memoria reservada anteriormente delete title; }