Click here to Skip to main content
15,912,756 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
General_stprint implementation Pin
Abhi Lahare28-Jun-05 0:24
Abhi Lahare28-Jun-05 0:24 
GeneralRe: _stprint implementation Pin
ThatsAlok28-Jun-05 1:00
ThatsAlok28-Jun-05 1:00 
GeneralRe: _stprint implementation Pin
Chris Losinger28-Jun-05 4:58
professionalChris Losinger28-Jun-05 4:58 
GeneralRe: _stprint implementation Pin
Abhi Lahare28-Jun-05 21:14
Abhi Lahare28-Jun-05 21:14 
GeneralI jsut need to get thsi to work someoen how Pin
Cillieacc0rd5o427-Jun-05 23:38
Cillieacc0rd5o427-Jun-05 23:38 
GeneralRe: I jsut need to get thsi to work someoen how Pin
Nilesh K.27-Jun-05 23:46
Nilesh K.27-Jun-05 23:46 
GeneralRe: I jsut need to get thsi to work someoen how Pin
Cillieacc0rd5o428-Jun-05 1:10
Cillieacc0rd5o428-Jun-05 1:10 
GeneralCBitmap - creation problem Pin
Member 206111627-Jun-05 22:43
Member 206111627-Jun-05 22:43 
Hi!

I am loading a file into a CBitmap object, draw it and so on. Then I save it to my own file format and like to read it afterwards again. The saved values and loaded values are the same but I cannot create a bitmap from the loaded values.
Here is my code:

//read from my file bitmap header
fread(&bit,sizeof(BITMAP),1,f);
int bsize=bit.bmWidthBytes*bit.bmHeight;

//read bitmap bits
buf=(BYTE*)malloc(bsize);
fread(buf,bsize,1,f);

//delete previous bitmap
DeleteObject();
//and create new one
CreateBitmap(bit.bmWidth,bit.bmHeight,bit.bmPlanes,bit.bmBitsPixel,buf);

The result of CreateBitmap() is 1 so it seems to work. But my screen stays blank. When I remove DeleteObject and CreateBitmap and use SetBitmapBits with my loaded bitmap data then I can see my saved picture. This is because I overwrite the previous loaded picture.

The problem seems to be CreateBitmap...anybody an idea?

Please help!!
Thx
Flo
GeneralRe: CBitmap - creation problem Pin
Nilesh K.27-Jun-05 22:52
Nilesh K.27-Jun-05 22:52 
GeneralRe: CBitmap - creation problem Pin
Member 206111628-Jun-05 0:55
Member 206111628-Jun-05 0:55 
GeneralPopup Menu in Tree Control Pin
Ram Murugan27-Jun-05 22:19
Ram Murugan27-Jun-05 22:19 
GeneralRe: Popup Menu in Tree Control Pin
Nilesh K.27-Jun-05 22:30
Nilesh K.27-Jun-05 22:30 
GeneralRe: Popup Menu in Tree Control Pin
ThatsAlok27-Jun-05 22:46
ThatsAlok27-Jun-05 22:46 
GeneralRe: Popup Menu in Tree Control Pin
Ram Murugan27-Jun-05 23:43
Ram Murugan27-Jun-05 23:43 
GeneralMprConfigGetFriendlyName returnins "Access denied" Pin
Per Nilsson27-Jun-05 21:59
Per Nilsson27-Jun-05 21:59 
GeneralRe: MprConfigGetFriendlyName returnins "Access denied" Pin
Nilesh K.27-Jun-05 22:22
Nilesh K.27-Jun-05 22:22 
GeneralTab Control in window Pin
Anonymous27-Jun-05 21:41
Anonymous27-Jun-05 21:41 
GeneralRe: Tab Control in window Pin
Nilesh K.27-Jun-05 22:01
Nilesh K.27-Jun-05 22:01 
GeneralRe: Tab Control in window Pin
ask_you27-Jun-05 22:14
ask_you27-Jun-05 22:14 
GeneralRe: Tab Control in window Pin
Nilesh K.27-Jun-05 22:34
Nilesh K.27-Jun-05 22:34 
QuestionHow to release memeory? Pin
rushing27-Jun-05 20:13
rushing27-Jun-05 20:13 
AnswerRe: How to release memeory? Pin
Cillieacc0rd5o427-Jun-05 20:18
Cillieacc0rd5o427-Jun-05 20:18 
Generalconjunction with Message ...... Pin
janakiraman200027-Jun-05 19:47
janakiraman200027-Jun-05 19:47 
GeneralRe: conjunction with Message ...... Pin
Christian Graus27-Jun-05 19:54
protectorChristian Graus27-Jun-05 19:54 
GeneralMouse event in transparent aera Pin
suhongwen27-Jun-05 19:38
suhongwen27-Jun-05 19:38 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.