prog.cpp: In function ‘int rtf_load_image(char*, int, int)’:
prog.cpp:9:14: error: ‘RTF_SUCCESS’ was not declared in this scope
int error = RTF_SUCCESS;
^
prog.cpp:13:26: error: ‘strstr’ was not declared in this scope
if ( strstr(image,".bmp") == NULL )
^
prog.cpp:26:8: error: ‘rtfPicture’ was not declared in this scope
if ( rtfPicture != NULL )
^
prog.cpp:53:3: error: ‘HGLOBAL’ was not declared in this scope
HGLOBAL hGlobal = GlobalAlloc(GMEM_MOVEABLE, sz);
^
prog.cpp:53:11: error: expected ‘;’ before ‘hGlobal’
HGLOBAL hGlobal = GlobalAlloc(GMEM_MOVEABLE, sz);
^
prog.cpp:54:28: error: ‘hGlobal’ was not declared in this scope
void* pData = GlobalLock(hGlobal);
^
prog.cpp:54:35: error: ‘GlobalLock’ was not declared in this scope
void* pData = GlobalLock(hGlobal);
^
prog.cpp:55:28: error: ‘memcpy’ was not declared in this scope
memcpy(pData, &buf[0], sz);
^
prog.cpp:56:23: error: ‘GlobalUnlock’ was not declared in this scope
GlobalUnlock(hGlobal);
^
prog.cpp:58:3: error: ‘IStream’ was not declared in this scope
IStream* pStream = NULL;
^
prog.cpp:58:12: error: ‘pStream’ was not declared in this scope
IStream* pStream = NULL;
^
prog.cpp:59:39: error: ‘TRUE’ was not declared in this scope
if ( CreateStreamOnHGlobal(hGlobal, TRUE, &pStream) == S_OK )
^
prog.cpp:59:53: error: ‘CreateStreamOnHGlobal’ was not declared in this scope
if ( CreateStreamOnHGlobal(hGlobal, TRUE, &pStream) == S_OK )
^
prog.cpp:59:58: error: ‘S_OK’ was not declared in this scope
if ( CreateStreamOnHGlobal(hGlobal, TRUE, &pStream) == S_OK )
^
prog.cpp:61:4: error: ‘HRESULT’ was not declared in this scope
HRESULT hr;
^
prog.cpp:61:12: error: expected ‘;’ before ‘hr’
HRESULT hr;
^
prog.cpp:62:9: error: ‘hr’ was not declared in this scope
if ((hr = OleLoadPicture( pStream, sz, FALSE, IID_IPicture, (LPVOID *)&rtfPicture)) != S_OK)
^
prog.cpp:62:43: error: ‘FALSE’ was not declared in this scope
if ((hr = OleLoadPicture( pStream, sz, FALSE, IID_IPicture, (LPVOID *)&rtfPicture)) != S_OK)
^
prog.cpp:62:50: error: ‘IID_IPicture’ was not declared in this scope
if ((hr = OleLoadPicture( pStream, sz, FALSE, IID_IPicture, (LPVOID *)&rtfPicture)) != S_OK)
^
prog.cpp:62:65: error: ‘LPVOID’ was not declared in this scope
if ((hr = OleLoadPicture( pStream, sz, FALSE, IID_IPicture, (LPVOID *)&rtfPicture)) != S_OK)
^
prog.cpp:62:73: error: expected primary-expression before ‘)’ token
if ((hr = OleLoadPicture( pStream, sz, FALSE, IID_IPicture, (LPVOID *)&rtfPicture)) != S_OK)
^
prog.cpp:62:75: error: ‘rtfPicture’ was not declared in this scope
if ((hr = OleLoadPicture( pStream, sz, FALSE, IID_IPicture, (LPVOID *)&rtfPicture)) != S_OK)
^
prog.cpp:62:85: error: ‘OleLoadPicture’ was not declared in this scope
if ((hr = OleLoadPicture( pStream, sz, FALSE, IID_IPicture, (LPVOID *)&rtfPicture)) != S_OK)
^
prog.cpp:63:13: error: ‘RTF_IMAGE_ERROR’ was not declared in this scope
error = RTF_IMAGE_ERROR;
^
prog.cpp:71:8: error: ‘rtfPicture’ was not declared in this scope
if ( rtfPicture != NULL )
^
prog.cpp:75:14: error: expected type-specifier before ‘HDC’
operator HDC() const {
^
prog.cpp:85:5: error: ‘HDC’ does not name a type
HDC _dc;
^
prog.cpp: In destructor ‘rtf_load_image(char*, int, int)::DC::~DC()’:
prog.cpp:79:6: error: ‘::ReleaseDC’ has not been declared
::ReleaseDC( ::GetDesktopWindow(), this->_dc );
^
prog.cpp:79:19: error: ‘::GetDesktopWindow’ has not been declared
::ReleaseDC( ::GetDesktopWindow(), this->_dc );
^
prog.cpp:79:47: error: ‘class rtf_load_image(char*, int, int)::DC’ has no member named ‘_dc’
::ReleaseDC( ::GetDesktopWindow(), this->_dc );
^
prog.cpp: In constructor ‘rtf_load_image(char*, int, int)::DC::DC()’:
prog.cpp:82:8: error: class ‘rtf_load_image(char*, int, int)::DC’ does not have any field named ‘_dc’
: _dc( ::GetDC( ::GetDesktopWindow() ) )
^
prog.cpp:82:13: error: ‘::GetDC’ has not been declared
: _dc( ::GetDC( ::GetDesktopWindow() ) )
^
prog.cpp:82:22: error: ‘::GetDesktopWindow’ has not been declared
: _dc( ::GetDC( ::GetDesktopWindow() ) )
^
prog.cpp: In function ‘int rtf_load_image(char*, int, int)’:
prog.cpp:94:52: error: ‘LOGPIXELSX’ was not declared in this scope
int nWidth = MulDiv( hmWidth, GetDeviceCaps( dc,LOGPIXELSX), 2540 );
^
prog.cpp:94:62: error: ‘GetDeviceCaps’ was not declared in this scope
int nWidth = MulDiv( hmWidth, GetDeviceCaps( dc,LOGPIXELSX), 2540 );
^
prog.cpp:94:70: error: ‘MulDiv’ was not declared in this scope
int nWidth = MulDiv( hmWidth, GetDeviceCaps( dc,LOGPIXELSX), 2540 );
^
prog.cpp:95:54: error: ‘LOGPIXELSY’ was not declared in this scope
int nHeight = MulDiv( hmHeight, GetDeviceCaps( dc,LOGPIXELSY), 2540 );
^
prog.cpp:98:4: error: ‘HDC’ was not declared in this scope
HDC hdcMeta = CreateMetaFile(NULL);
^
prog.cpp:98:8: error: expected ‘;’ before ‘hdcMeta’
HDC hdcMeta = CreateMetaFile(NULL);
^
prog.cpp:101:24: error: ‘hdcMeta’ was not declared in this scope
rtfPicture->Render( hdcMeta, 0, 0, nWidth, nHeight, 0, hmHeight, hmWidth, -hmHeight, NULL );
^
prog.cpp:104:4: error: ‘HMETAFILE’ was not declared in this scope
HMETAFILE hmf = CloseMetaFile(hdcMeta);
^
prog.cpp:104:14: error: expected ‘;’ before ‘hmf’
HMETAFILE hmf = CloseMetaFile(hdcMeta);
^
prog.cpp:107:4: error: ‘UINT’ was not declared in this scope
UINT size = GetMetaFileBitsEx( hmf, 0, NULL );
^
prog.cpp:107:9: error: expected ‘;’ before ‘size’
UINT size = GetMetaFileBitsEx( hmf, 0, NULL );
^
prog.cpp:108:4: error: ‘BYTE’ was not declared in this scope
BYTE* buffer = new BYTE[size];
^
prog.cpp:108:10: error: ‘buffer’ was not declared in this scope
BYTE* buffer = new BYTE[size];
^
prog.cpp:108:23: error: expected type-specifier before ‘BYTE’
BYTE* buffer = new BYTE[size];
^
prog.cpp:108:23: error: expected ‘;’ before ‘BYTE’
prog.cpp:109:23: error: ‘hmf’ was not declared in this scope
GetMetaFileBitsEx( hmf, size, buffer );
^
prog.cpp:109:28: error: ‘size’ was not declared in this scope
GetMetaFileBitsEx( hmf, size, buffer );
^
prog.cpp:109:41: error: ‘GetMetaFileBitsEx’ was not declared in this scope
GetMetaFileBitsEx( hmf, size, buffer );
^
prog.cpp:110:22: error: ‘DeleteMetaFile’ was not declared in this scope
DeleteMetaFile(hmf);
^
prog.cpp:113:50: error: ‘rtf_bin_hex_convert’ was not declared in this scope
char* str = rtf_bin_hex_convert( buffer, size );
^
prog.cpp:114:13: error: type ‘<type error>’ argument given to ‘delete’, expected pointer
delete []buffer;
^
prog.cpp:117:4: error: ‘RTF_PARAGRAPH_FORMAT’ was not declared in this scope
RTF_PARAGRAPH_FORMAT* pf = rtf_get_paragraphformat();
^
prog.cpp:117:26: error: ‘pf’ was not declared in this scope
RTF_PARAGRAPH_FORMAT* pf = rtf_get_paragraphformat();
^
prog.cpp:117:55: error: ‘rtf_get_paragraphformat’ was not declared in this scope
RTF_PARAGRAPH_FORMAT* pf = rtf_get_paragraphformat();
^
prog.cpp:119:30: error: ‘rtf_write_paragraphformat’ was not declared in this scope
rtf_write_paragraphformat();
^
prog.cpp:123:132: warning: format ‘%d’ expects argument of type ‘int’, but argument 3 has type ‘long int’ [-Wformat=]
sprintf( rtfText, "\n{\\pict\\wmetafile8\\picwgoal%d\\pichgoal%d\\picscalex%d\\picscaley%d\n", hmWidth, hmHeight, width, height );
^
prog.cpp:123:132: warning: format ‘%d’ expects argument of type ‘int’, but argument 4 has type ‘long int’ [-Wformat=]
prog.cpp:124:43: error: ‘strlen’ was not declared in this scope
if ( fwrite( rtfText, 1, strlen(rtfText), rtfFile ) < strlen(rtfText) )
^
prog.cpp:124:46: error: ‘rtfFile’ was not declared in this scope
if ( fwrite( rtfText, 1, strlen(rtfText), rtfFile ) < strlen(rtfText) )
^
prog.cpp:125:13: error: ‘RTF_IMAGE_ERROR’ was not declared in this scope
error = RTF_IMAGE_ERROR;
^
prog.cpp:126:28: error: ‘rtfFile’ was not declared in this scope
fwrite( str, 1, 2*size, rtfFile );
^
prog.cpp:127:25: error: ‘strcpy’ was not declared in this scope
strcpy( rtfText, "}" );
^
prog.cpp:128:38: error: ‘strlen’ was not declared in this scope
fwrite( rtfText, 1, strlen(rtfText), rtfFile );
^
prog.cpp:135:75: error: ‘strcpy’ was not declared in this scope
strcpy( rtfText, "\n\\par\\pard *** Error! Wrong image format ***\\par" );
^
prog.cpp:136:37: error: ‘strlen’ was not declared in this scope
fwrite( rtfText, 1, strlen(rtfText), rtfFile );
^
prog.cpp:136:40: error: ‘rtfFile’ was not declared in this scope
fwrite( rtfText, 1, strlen(rtfText), rtfFile );
^
prog.cpp: At global scope:
prog.cpp:143:11: error: ‘::main’ must return ‘int’
void main()
^
prog.cpp: In function ‘int main()’:
prog.cpp:145:37: error: ‘rtf_open’ was not declared in this scope
rtf_open( "R:\\rtf\\rtf\\test.rtf" );
^
prog.cpp:147:50: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
rtf_load_image( "R:\\rtf\\rtf\\123.bmp", 32, 32 );
^
prog.cpp:149:12: error: ‘rtf_close’ was not declared in this scope
rtf_close();
^