C language > Graphics programming
How to use Windows Imaging Framework
leandrojardim:
I have this code as seen in MSDN:
--- Code: ---#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));
--- End code ---
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!
TimoVJL:
You example was for C++.
So
--- Code: ---#define IID_PPV_ARGS(ppType) ((void**)(ppType))
Result = CoCreateInstance(&CLSID_WICImagingFactory, NULL, CLSCTX_INPROC_SERVER, &IID_IWICImagingFactory, IID_PPV_ARGS(&Factory));
--- End code ---
or
--- Code: ---Result = CoCreateInstance(&CLSID_WICImagingFactory, NULL, CLSCTX_INPROC_SERVER, &IID_IWICImagingFactory, (void**)&Factory);
--- End code ---
leandrojardim:
Thanks, timo! :)
_SIL_:
Is there a way to use IWICImagingFactory or IImagingFactory on WinCe???
In winmobile SDK no wincodec.h. Need help!
TimoVJL:
--- Quote ---IImagingFactory on WinCe???
--- End quote ---
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://www.microsoft.com/en-us/download/details.aspx?id=17310
Navigation
[0] Message Index
[#] Next page
Go to full version