39 |
|
|
40 |
#include "wptJPG.h" |
#include "wptJPG.h" |
41 |
|
|
42 |
#define HIMETRIC_INCH 2540 |
#define HIMETRIC_INCH 2540 |
43 |
#define ERROR_TITLE "CJPG Error" /* Error Title (Related To This Class)...*/ |
#define ERROR_TITLE "CJPG Error" |
44 |
|
|
45 |
#define out_of_core() do { \ |
#define out_of_core() do { \ |
46 |
MessageBox (NULL, "Can not allocate memory", ERROR_TITLE, MB_OK|MB_ICONSTOP); \ |
MessageBox (NULL, "Can not allocate memory", ERROR_TITLE, MB_OK|MB_ICONSTOP); \ |
157 |
|
|
158 |
if (CreateStreamOnHGlobal (hGlobal, TRUE, &pStream) == S_OK) { |
if (CreateStreamOnHGlobal (hGlobal, TRUE, &pStream) == S_OK) { |
159 |
HRESULT hr; |
HRESULT hr; |
160 |
hr = OleLoadPicture (pStream, nSize, FALSE, IID_IPicture, (LPVOID *)&m_IPicture); |
hr = OleLoadPicture (pStream, nSize, FALSE, IID_IPicture, |
161 |
|
(LPVOID *)&m_IPicture); |
162 |
if (hr == E_NOINTERFACE) { |
if (hr == E_NOINTERFACE) { |
163 |
MessageBox (NULL, "IPicture interface is not supported", ERROR_TITLE, MB_OK|MB_ICONSTOP); |
MessageBox (NULL, "IPicture interface is not supported", |
164 |
|
ERROR_TITLE, MB_OK|MB_ICONSTOP); |
165 |
return FALSE; |
return FALSE; |
166 |
} |
} |
167 |
else { /* S_OK */ |
else { /* S_OK */ |