Thanks.

This is the code:

Code:
inline int Aleatorio(int nMin, int nMax) {	
	UINT nNumero = 0;
	rand_s(&nNumero);	
	UINT n_s = nMin + nNumero % (nMax + 1 - nMin);
	return n_s;
}
Best regards, Toño