didier2$2007132
didier2

05/13/2007 :: 18:40

Registered

hello,
i am trying todislay an picture on a viewer.
i am doing:
picture.CreatePictureFromFile(),
viewer.DisplayFromImageRef(picture.GetNative()); <<- crash in gdiplus.dll

if i directly call viewer.DislayfroFile() this is fine.

i noticesd that the nImageId returned by CreateImageFromFile() is not the same than the GetNative one ?! maybe something is wrong dring the creation ...

i am using mfc/atl,

sorry for didier2 i forgot my pass and cannot get it back ...

didier2$2007132
didier2

05/13/2007 :: 20:21

Registered

Ok there is a small bug in the picture function: if the lpdispatch of the picture class is not set the return value is not initialised, but nothing is done. it means that the stupid coder that i am was considering that function returned corretcly but it didnt so crash as nImageId was junk.

for the lpdispatch under mfc please before using the picture class call m_gdPicture.CreateDispatch("GdpicturePro.cGdPicture");

cheers
back to forum