Pelles C forum
C language => Graphics programming => Topic started by: leandrojardim on April 25, 2012, 11:04:34 PM
-
I have this code as seen in MSDN:
#include <windows.h>
#include <wincodec.h>
void foobar (void) {
HRESULT Result = 0;
IWICImagingFactory *Factory = NULL;
CoInitialize(NULL);
Result = CoCreateInstance(CLSID_WICImagingFactory, NULL, CLSCTX_INPROC_SERVER, IID_IWICImagingFactory, IID_PPV_ARGS(&Factory));
D:\Documentos do Leandro\Pelles C Projects\Alien - Cópia\ball.c(255): error #2140: Type error in argument 1 to 'CoCreateInstance'; expected 'LPCGUID const' but found 'UOW'.
D:\Documentos do Leandro\Pelles C Projects\Alien - Cópia\ball.c(255): error #2140: Type error in argument 4 to 'CoCreateInstance'; expected 'LPCGUID const' but found 'UOW'.
D:\Documentos do Leandro\Pelles C Projects\Alien - Cópia\ball.c(255): warning #2018: Undeclared function 'IID_PPV_ARGS'; assuming 'extern' returning 'int'.
D:\Documentos do Leandro\Pelles C Projects\Alien - Cópia\ball.c(255): error #2140: Type error in argument 5 to 'CoCreateInstance'; expected 'void * *' but found 'int'.
But it doesnt compile. What do I need to modify to make it work as expected?
Thanks!
-
You example was for C++.
So
#define IID_PPV_ARGS(ppType) ((void**)(ppType))
Result = CoCreateInstance(&CLSID_WICImagingFactory, NULL, CLSCTX_INPROC_SERVER, &IID_IWICImagingFactory, IID_PPV_ARGS(&Factory));
orResult = CoCreateInstance(&CLSID_WICImagingFactory, NULL, CLSCTX_INPROC_SERVER, &IID_IWICImagingFactory, (void**)&Factory);
-
Thanks, timo! :)
-
Is there a way to use IWICImagingFactory or IImagingFactory on WinCe???
In winmobile SDK no wincodec.h. Need help!
-
IImagingFactory on WinCe???
Requirements
OS Versions: Windows CE 5.0 and later.
Header: Imaging.h
Link Library: Imaging.lib
It is COM based and Imaging.h is for C++ only.
http://msdn.microsoft.com/en-us/library/aa452202 (http://msdn.microsoft.com/en-us/library/aa452202)
http://www.microsoft.com/en-us/download/details.aspx?id=17310 (http://www.microsoft.com/en-us/download/details.aspx?id=17310)
-
Thanks, timovjl.
I need only draw several *png with transparency on my form. In evc4 i have worked sample, but i like pelles more than evc.
Maybe you can suggest me easy way to do that in pelles с ? ???
Target prog is very simple so i would't want to overload by libpng or cximage librarys....
-
How about using GDI+ instead, if that is available on WinCE?
-
Here is simple example with partially converted header file.
-
Here is simple example with partially converted header file.
Wow! You Great! Compilled sample work fine!
Can you show your ImgTest.h? Please!!!
-
Oops, but now it is in that zip.
-
Many, many thanks!!!
Work fine with CreateImageFromStream() too.
For using GetImageInfo() ImgTest.h also need that
typedef INT PixelFormat;
struct ImageInfo{
GUID RawDataFormat;
PixelFormat PixelFormat;
UINT Width, Height;
UINT TileWidth, TileHeight;
double Xdpi, Ydpi;
UINT Flags;
};
Thanks!
-----
screen from my prog: http://lostpic.net/images/ccca17b85f423d928e4bcd61626f03dc.png