Click here to Skip to main content
11,798,046 members (77,985 online)
Rate this: bad
Please Sign up or sign in to vote.
See more: VC8.0
How to open the file using fopen_s to save the image??? Please help me...

for(int c=0;c<10;c++)
		 CString sName(buffer);  
         LPCTSTR lpszName = sName; 
         if( (err = fopen_s( &stream2, "data2", "w+" )) != 0 )
		file.Write(&bh, sizeof(BITMAPFILEHEADER));
			file.Write(&(bi.bmiHeader), sizeof(BITMAPINFOHEADER));
			file.Write(lpBitmapBits, 3 * nWidth * nHeight);
Posted 18-Apr-11 23:44pm
walterhevedeich at 19-Apr-11 5:49am
What's the error message you are receiving?
SAKryukov at 19-Apr-11 13:14pm
Did you remove your Question:

...after I answered and added the update. Why?!
Gokulnath007 at 20-Apr-11 0:23am
No. i didnt remove it..
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

Buddy as per i understand your problem you are trying to copy content of image file to a normal file it is ok to do it...Smile | :)

But if you are trying to convert one kind of file to another type then it is not the right way to do so..

Instead you can use GDIPLUS for programmers: GDI+[^]

Hope this may help!!! Smile | :)
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

You're obviously using MFC. Why don't you go ahead and use the framework's classes?

CBitmap myBmp;
CImage myImg;
Niklas Lindquist at 19-Apr-11 7:39am
I think he's trying to rid himself of MFC as per his other questions.
Gokulnath007 at 20-Apr-11 0:25am
I need these codes which is taking the screenshots of the screen to be run as a service so that it can start taking the screen shots once the service is started.. please help me..

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 CPallini 575
1 Maciej Los 375
2 OriginalGriff 353
3 Abhinav S 342
4 Richard MacCutchan 218
0 OriginalGriff 2,150
1 Maciej Los 1,790
2 KrunalRohit 1,456
3 CPallini 1,415
4 Richard MacCutchan 1,016

Advertise | Privacy | Mobile
Web02 | 2.8.151002.1 | Last Updated 19 Apr 2011
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100