Hi Alexander,
I have been learning a lot from you. I don't know about the Register PSDK.. but I do know about the option setting since I have been trying to figure out all those errors earlier today. I have not tried the Register yet but I wonder how VC++ will search for files since some files like stdafx.h have multiple copies but different version in the computer.
I have read the capture.cpp. I believe there are only 2 places the GDI+ are called besides the startup and shutdown:
Bitmap img(bm, NULL)
img.Save(fn, &jpegClsid)
So, I believe I need to check the return value of img.getlaststatus right after each coding. The coding will be something like this:
Bitmap img(bm, NULL)
Status lastStatus = img.GetLastStatus();
if (lastStatus != Ok)
return -1;
img.Save(fn, &jpegClsid)
lastStatus = img.GetLastStatus();
if (lastStatus != Ok)
return -1;
I hope this is right. I have rebuilt the dll with this change.
You mentioned that if the image file exist already, the GDI+ will fail. Are you talking about the remarks in this link
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/gdicpp/GDIPlus/GDIPlusReference/Classes/ImageClass/ImageMethods/ImageSaveMethods/Save_39filename_clsidEncoder_encoderParams.asp. I have tried to capture the image many times without deleting the jpg file and it has no problem. I guess the remarks do not apply to your coding since the img is constructed using bm which is only a handle to the bitmap not an actual file. Is my guess correct?
Thank you for your help,
Peter