[Windows Mobile Development and Hacking General] evilc:
Thanks for the post.

What framework is that?

If I drop the sample code into a test project and try to build I get:

C:\Program Files\Microsoft eMbedded C++ 4.0\Common\EVC\MyProjects\test1\test1.cpp(207) : error C2065: 'IImagingFactory' : undeclared identifier
C:\Program Files\Microsoft eMbedded C++ 4.0\Common\EVC\MyProjects\test1\test1.cpp(207) : error C2065: 'm_pImgFactory' : undeclared identifier
C:\Program Files\Microsoft eMbedded C++ 4.0\Common\EVC\MyProjects\test1\test1.cpp(207) : warning C4552: '*' : operator has no effect; expected operator with side-effect
C:\Program Files\Microsoft eMbedded C++ 4.0\Common\EVC\MyProjects\test1\test1.cpp(211) : error C2065: 'CLSID_ImagingFactory' : undeclared identifier
C:\Program Files\Microsoft eMbedded C++ 4.0\Common\EVC\MyProjects\test1\test1.cpp(211) : error C2065: 'IID_IImagingFactory' : undeclared identifier
C:\Program Files\Microsoft eMbedded C++ 4.0\Common\EVC\MyProjects\test1\test1.cpp(222) : error C2227: left of '->CreateImageFromFile' must point to class/struct/union
C:\Program Files\Microsoft eMbedded C++ 4.0\Common\EVC\MyProjects\test1\test1.cpp(222) : error C2065: 'lpstrPngImageFileName' : undeclared identifier
C:\Program Files\Microsoft eMbedded C++ 4.0\Common\EVC\MyProjects\test1\test1.cpp(222) : error C2065: 'm_pImage' : undeclared identifier
C:\Program Files\Microsoft eMbedded C++ 4.0\Common\EVC\MyProjects\test1\test1.cpp(224) : error C2065: 'ImageInfo' : undeclared identifier
C:\Program Files\Microsoft eMbedded C++ 4.0\Common\EVC\MyProjects\test1\test1.cpp(224) : error C2146: syntax error : missing ';' before identifier 'info'
C:\Program Files\Microsoft eMbedded C++ 4.0\Common\EVC\MyProjects\test1\test1.cpp(224) : error C2065: 'info' : undeclared identifier
C:\Program Files\Microsoft eMbedded C++ 4.0\Common\EVC\MyProjects\test1\test1.cpp(224) : error C2059: syntax error : '{'
C:\Program Files\Microsoft eMbedded C++ 4.0\Common\EVC\MyProjects\test1\test1.cpp(224) : error C2143: syntax error : missing ';' before '{'
C:\Program Files\Microsoft eMbedded C++ 4.0\Common\EVC\MyProjects\test1\test1.cpp(224) : error C2143: syntax error : missing ';' before '}'
C:\Program Files\Microsoft eMbedded C++ 4.0\Common\EVC\MyProjects\test1\test1.cpp(225) : error C2227: left of '->GetImageInfo' must point to class/struct/union
C:\Program Files\Microsoft eMbedded C++ 4.0\Common\EVC\MyProjects\test1\test1.cpp(226) : error C2065: 'm_nWidth' : undeclared identifier
C:\Program Files\Microsoft eMbedded C++ 4.0\Common\EVC\MyProjects\test1\test1.cpp(226) : error C2228: left of '.Width' must have class/struct/union type
C:\Program Files\Microsoft eMbedded C++ 4.0\Common\EVC\MyProjects\test1\test1.cpp(227) : error C2065: 'm_nHeight' : undeclared identifier
C:\Program Files\Microsoft eMbedded C++ 4.0\Common\EVC\MyProjects\test1\test1.cpp(227) : error C2228: left of '.Height' must have class/struct/union type
C:\Program Files\Microsoft eMbedded C++ 4.0\Common\EVC\MyProjects\test1\test1.cpp(232) : error C2065: 'err' : undeclared identifier
C:\Program Files\Microsoft eMbedded C++ 4.0\Common\EVC\MyProjects\test1\test1.cpp(237) : error C2065: 'm_nPosX' : undeclared identifier
C:\Program Files\Microsoft eMbedded C++ 4.0\Common\EVC\MyProjects\test1\test1.cpp(238) : error C2065: 'm_nPosY' : undeclared identifier
C:\Program Files\Microsoft eMbedded C++ 4.0\Common\EVC\MyProjects\test1\test1.cpp(241) : error C2227: left of '->Draw' must point to class/struct/union
C:\Program Files\Microsoft eMbedded C++ 4.0\Common\EVC\MyProjects\test1\test1.cpp(241) : error C2065: 'm_hDC' : undeclared identifier
C:\Program Files\Microsoft eMbedded C++ 4.0\Common\EVC\MyProjects\test1\test1.cpp(243) : error C2227: left of '->Release' must point to class/struct/union
C:\Program Files\Microsoft eMbedded C++ 4.0\Common\EVC\MyProjects\test1\test1.cpp(244) : error C2227: left of '->Release' must point to class/struct/union
Error executing cl.exe.

Adding #include <imaging.h> to the top brings this error list down to:

C:\Program Files\Microsoft eMbedded C++ 4.0\Common\EVC\MyProjects\test1\test1.cpp(212) : error C2065: 'm_pImgFactory' : undeclared identifier
C:\Program Files\Microsoft eMbedded C++ 4.0\Common\EVC\MyProjects\test1\test1.cpp(223) : error C2227: left of '->CreateImageFromFile' must point to class/struct/union
C:\Program Files\Microsoft eMbedded C++ 4.0\Common\EVC\MyProjects\test1\test1.cpp(223) : error C2065: 'lpstrPngImageFileName' : undeclared identifier
C:\Program Files\Microsoft eMbedded C++ 4.0\Common\EVC\MyProjects\test1\test1.cpp(223) : error C2065: 'm_pImage' : undeclared identifier
C:\Program Files\Microsoft eMbedded C++ 4.0\Common\EVC\MyProjects\test1\test1.cpp(226) : error C2227: left of '->GetImageInfo' must point to class/struct/union
C:\Program Files\Microsoft eMbedded C++ 4.0\Common\EVC\MyProjects\test1\test1.cpp(227) : error C2065: 'm_nWidth' : undeclared identifier
C:\Program Files\Microsoft eMbedded C++ 4.0\Common\EVC\MyProjects\test1\test1.cpp(228) : error C2065: 'm_nHeight' : undeclared identifier
C:\Program Files\Microsoft eMbedded C++ 4.0\Common\EVC\MyProjects\test1\test1.cpp(233) : error C2065: 'err' : undeclared identifier
C:\Program Files\Microsoft eMbedded C++ 4.0\Common\EVC\MyProjects\test1\test1.cpp(238) : error C2065: 'm_nPosX' : undeclared identifier
C:\Program Files\Microsoft eMbedded C++ 4.0\Common\EVC\MyProjects\test1\test1.cpp(239) : error C2065: 'm_nPosY' : undeclared identifier
C:\Program Files\Microsoft eMbedded C++ 4.0\Common\EVC\MyProjects\test1\test1.cpp(242) : error C2227: left of '->Draw' must point to class/struct/union
C:\Program Files\Microsoft eMbedded C++ 4.0\Common\EVC\MyProjects\test1\test1.cpp(242) : error C2065: 'm_hDC' : undeclared identifier
C:\Program Files\Microsoft eMbedded C++ 4.0\Common\EVC\MyProjects\test1\test1.cpp(244) : error C2227: left of '->Release' must point to class/struct/union
C:\Program Files\Microsoft eMbedded C++ 4.0\Common\EVC\MyProjects\test1\test1.cpp(245) : error C2227: left of '->Release' must point to class/struct/union
Error executing cl.exe.