OLE
-
i am using OLE IPicture interface to load images but i am having troublr with the foolowing line of code "OleLoadPicturePath(OlePathName,NULL,0,0,&IID_IPicture,(void *)(&Ipic));" when i try to compile it the compile genertes a type casting error for parameter 5. i think i am using the correct syntax. Can any one tell me what the problem is. Aizaz
-
i am using OLE IPicture interface to load images but i am having troublr with the foolowing line of code "OleLoadPicturePath(OlePathName,NULL,0,0,&IID_IPicture,(void *)(&Ipic));" when i try to compile it the compile genertes a type casting error for parameter 5. i think i am using the correct syntax. Can any one tell me what the problem is. Aizaz
Aizaz wrote: OleLoadPicturePath(OlePathName,NULL,0,0,&IID_IPicture,(void *)(&Ipic)); You only fed it 6 arguments for that function. No wonder~~~ :-D
Maxwell Chen
-
i am using OLE IPicture interface to load images but i am having troublr with the foolowing line of code "OleLoadPicturePath(OlePathName,NULL,0,0,&IID_IPicture,(void *)(&Ipic));" when i try to compile it the compile genertes a type casting error for parameter 5. i think i am using the correct syntax. Can any one tell me what the problem is. Aizaz
Its defined as : STDAPI OleLoadPicturePath{ LPOLESTR szURLorPath, LPUNKNOWN punkCaller, DWORD dwReserved, OLE_COLOR clrReserved, REFIID riid, LPVOID *ppvRet } So parm 5 is of type REFIDD - in C that expands to IID* or in C++ it expands to IID&. Your passing &IID_IPicture - IE IID*. Change it to: OleLoadPicturePath(OlePathName,NULL,0,0,IID_IPicture,(void *)(&Ipic)); On a side note, 6 is also wrong. Its of type LPVOID* - or void**. So persuming your IPic is IUnknown* (or whatever) you pass (void**)&Ipic - so in total OleLoadPicturePath(OlePathName, NULL, 0, 0, IID_IPicture,(void**)&Ipic);
-
i am using OLE IPicture interface to load images but i am having troublr with the foolowing line of code "OleLoadPicturePath(OlePathName,NULL,0,0,&IID_IPicture,(void *)(&Ipic));" when i try to compile it the compile genertes a type casting error for parameter 5. i think i am using the correct syntax. Can any one tell me what the problem is. Aizaz
It should be IID_IPicture and not &IID_IPicture