El tema es asi:
1)Estoy tratando de reutilizar codigo de una aplicacion a otra, la nueva aplicacion es una DLL dinamica.
2)Creo un "RIV_Varios.h"
#ifndef __RIV_Varios_H__
#define __RIV_Varios_H__
//#include "stdafx.h"
class CRIV_Varios //: public CDialog
{
private:
// Construction
public:
int Byte_2_Hex(char Byte_Entrada, char *Char_Salida);
unsigned int read_16u(FILE *fp);
unsigned long read_32u(FILE *fp);
// Implementation
protected:
};
#endif
3)Creo un "RIV_Varios.Cpp"
#include "RIV_Varios.h"
//////////////////////////////////
unsigned long CRIV_Varios::read_32u(FILE *fp)
{
unsigned char b0,b1,b2,b3; // bytes from file
b0 = getc(fp);
b1 = getc(fp);
b2 = getc(fp);
b3 = getc(fp);
return (unsigned long)((((((b3<<8)|b2)<<8)|b1)<<8)|b0);
}
// Similarly for writing to file
// Other routines need to be written for 16 bit (signed/unsigned)
//////////////////////////////////
//////////////////////////////////
unsigned int CRIV_Varios::read_16u(FILE *fp)
{
unsigned char b0,b1; // bytes from file
b0 = getc(fp);
b1 = getc(fp);
return (unsigned int)((b1<<8)|b0);
}
//////////////////////////////////
//////////////////////////////////
int CRIV_Varios::Byte_2_Hex(char Byte_Entrada, char *Char_Salida)
{
char aux_char;
aux_char = Byte_Entrada;
aux_char = aux_char & 0x0000000F;
if (aux_char <= 0x9)
{
Char_Salida[1] = ( aux_char ) + 0x30;
}
else
{
Char_Salida[1] = aux_char + 0x37;
}
aux_char = Byte_Entrada;
aux_char = aux_char >> 4;
aux_char = aux_char & 0x0000000F;
if (aux_char <= 0x9)
{
Char_Salida[0] = aux_char + 0x30;
}
else
{
Char_Salida[0] = aux_char + 0x37;
}
return (0);
}
//////////////////////////////////
4)Compilo y me da este error:
RIV_Varios.cpp
c:*riv_varios.cpp(69) : fatal error C1010: unexpected end of file while looking for precompiled header directive
Y la verdad es que no se para donde agarrar, debe ser una tonteria solucionarlo, pero ?
Agredecere cualquier ayuda.