Click here to Skip to main content
11,493,233 members (61,955 online)

C / C++ / MFC

 
GeneralRe: Pop up window from a dialog based application Pin
Richard MacCutchan5-Feb-13 22:10
mvpRichard MacCutchan5-Feb-13 22:10 
GeneralRe: Pop up window from a dialog based application Pin
Member 80516116-Feb-13 23:45
memberMember 80516116-Feb-13 23:45 
GeneralRe: Pop up window from a dialog based application Pin
Richard MacCutchan7-Feb-13 0:43
mvpRichard MacCutchan7-Feb-13 0:43 
GeneralRe: Pop up window from a dialog based application Pin
Member 80516117-Feb-13 1:29
memberMember 80516117-Feb-13 1:29 
GeneralRe: Pop up window from a dialog based application Pin
Richard MacCutchan7-Feb-13 1:50
mvpRichard MacCutchan7-Feb-13 1:50 
GeneralRe: Pop up window from a dialog based application Pin
Member 805161111-Feb-13 20:55
memberMember 805161111-Feb-13 20:55 
GeneralRe: Pop up window from a dialog based application Pin
Member 80516115-Feb-13 20:33
memberMember 80516115-Feb-13 20:33 
AnswerRe: Pop up window from a dialog based application Pin
Albert Holguin4-Feb-13 13:18
memberAlbert Holguin4-Feb-13 13:18 
QuestionHow to Implement Drag & Drop feature for Imagesin MFC.? Pin
mbatra313-Feb-13 20:17
membermbatra313-Feb-13 20:17 
AnswerRe: How to Implement Drag & Drop feature for Imagesin MFC.? Pin
Jochen Arndt3-Feb-13 22:46
memberJochen Arndt3-Feb-13 22:46 
QuestionStuck in WaveInProc Pin
AmbiguousName2-Feb-13 8:21
memberAmbiguousName2-Feb-13 8:21 
AnswerRe: Stuck in WaveInProc Pin
CPallini2-Feb-13 11:38
mvpCPallini2-Feb-13 11:38 
AnswerRe: Stuck in WaveInProc Pin
Richard MacCutchan2-Feb-13 22:26
mvpRichard MacCutchan2-Feb-13 22:26 
QuestionBitmap creation from a buffer recived Pin
toms from newdelhi1-Feb-13 1:03
membertoms from newdelhi1-Feb-13 1:03 
Hello all!
I'm working on a program in which, I'm receiving the bytes of an image and after storing this creating a bitmap to display.
This is my Main code Please see this..

static char buff[MAX_SIZE];
	int num;
			
//receiving the bytes from a client		 
          num=recv(Socket, buff, sizeof(buff), 0);
 
		 
    // progress the buffer
  
				//ifstream creation	
				std::ifstream is;
 
					is.open(buff, std::ios::binary);
					is.seekg(0, std::ios::end);
					num = is.tellg();
					is.seekg(0, std::ios::beg);
					 
 
					//reading buffer
					is.read(buff, num);
 
					tagBITMAPFILEHEADER bfh = *(tagBITMAPFILEHEADER*)buff;
					tagBITMAPINFOHEADER bih = *(tagBITMAPINFOHEADER*)(buff+sizeof(tagBITMAPFILEHEADER));
 
					RGBQUAD             rgb = *(RGBQUAD*)(buff+sizeof(tagBITMAPFILEHEADER)+sizeof(tagBITMAPINFOHEADER));
 
 
					BITMAPINFO bi;
bi.bmiColors[0] = rgb;
bi.bmiHeader = bih;
char* pPixels = (buff+bfh.bfOffBits);
 
char* ppvBits;
 
 
hbitmap = CreateDIBSection(NULL, &bi, DIB_RGB_COLORS, (void**) &ppvBits, NULL, 0);
SetDIBits(NULL, hbitmap, 0, bih.biHeight, pPixels, &bi, DIB_RGB_COLORS);
 
GetObject(hbitmap, sizeof(BITMAP), &cBitmap);
	
 
On checking the bytes received,,its ok to be there from both client and server side, But my code is unable to read these bytes to create a bitmap.

Thanks in advance for your help!
AnswerRe: Bitmap creation from a buffer recived Pin
Richard MacCutchan1-Feb-13 1:40
mvpRichard MacCutchan1-Feb-13 1:40 
GeneralRe: Bitmap creation from a buffer recived Pin
toms from newdelhi1-Feb-13 1:56
membertoms from newdelhi1-Feb-13 1:56 
GeneralRe: Bitmap creation from a buffer recived Pin
Richard MacCutchan1-Feb-13 2:01
mvpRichard MacCutchan1-Feb-13 2:01 
GeneralRe: Bitmap creation from a buffer recived Pin
toms from newdelhi1-Feb-13 2:18
membertoms from newdelhi1-Feb-13 2:18 
GeneralRe: Bitmap creation from a buffer recived Pin
Richard MacCutchan1-Feb-13 2:35
mvpRichard MacCutchan1-Feb-13 2:35 
GeneralRe: Bitmap creation from a buffer recived Pin
toms from newdelhi1-Feb-13 2:46
membertoms from newdelhi1-Feb-13 2:46 
GeneralRe: Bitmap creation from a buffer recived Pin
Richard MacCutchan1-Feb-13 3:35
mvpRichard MacCutchan1-Feb-13 3:35 
GeneralRe: Bitmap creation from a buffer recived Pin
jibesh1-Feb-13 9:03
memberjibesh1-Feb-13 9:03 
QuestionMFC and printing Pin
Argonia31-Jan-13 6:43
memberArgonia31-Jan-13 6:43 
AnswerRe: MFC and printing Pin
sujayg1-Feb-13 17:21
membersujayg1-Feb-13 17:21 
QuestionMFC Smart Device App with Visual C++ in Visual Std 2008 Pin
sefasolak31-Jan-13 4:09
membersefasolak31-Jan-13 4:09 
AnswerRe: MFC Smart Device App with Visual C++ in Visual Std 2008 Pin
Richard MacCutchan31-Jan-13 4:45
mvpRichard MacCutchan31-Jan-13 4:45 
Questionunable to register COM dll 64 bit Pin
john563231-Jan-13 3:12
memberjohn563231-Jan-13 3:12 
AnswerRe: unable to register COM dll 64 bit Pin
«_Superman_»1-Feb-13 17:59
member«_Superman_»1-Feb-13 17:59 
QuestionPlay Media File Pin
john563230-Jan-13 20:38
memberjohn563230-Jan-13 20:38 
AnswerRe: Play Media File Pin
Flaviu230-Jan-13 22:47
memberFlaviu230-Jan-13 22:47 
GeneralRe: Play Media File Pin
john563231-Jan-13 2:07
memberjohn563231-Jan-13 2:07 
AnswerRe: Play Media File Pin
jeron131-Jan-13 5:28
memberjeron131-Jan-13 5:28 
GeneralRe: Play Media File Pin
john563231-Jan-13 18:09
memberjohn563231-Jan-13 18:09 
GeneralRe: Play Media File Pin
jeron11-Feb-13 8:27
memberjeron11-Feb-13 8:27 
GeneralRe: Play Media File Pin
merano1-Feb-13 15:11
membermerano1-Feb-13 15:11 
QuestionTCP Server: Render the image on server side Pin
toms from newdelhi30-Jan-13 2:29
membertoms from newdelhi30-Jan-13 2:29 
AnswerRe: TCP Server: Render the image on server side Pin
Richard MacCutchan30-Jan-13 4:01
mvpRichard MacCutchan30-Jan-13 4:01 
GeneralRe: TCP Server: Render the image on server side Pin
toms from newdelhi30-Jan-13 17:44
membertoms from newdelhi30-Jan-13 17:44 
GeneralRe: TCP Server: Render the image on server side Pin
Richard MacCutchan30-Jan-13 22:52
mvpRichard MacCutchan30-Jan-13 22:52 
GeneralRe: TCP Server: Render the image on server side Pin
toms from newdelhi30-Jan-13 23:53
membertoms from newdelhi30-Jan-13 23:53 
GeneralRe: TCP Server: Render the image on server side Pin
Richard MacCutchan30-Jan-13 23:56
mvpRichard MacCutchan30-Jan-13 23:56 
GeneralRe: TCP Server: Render the image on server side Pin
toms from newdelhi30-Jan-13 23:59
membertoms from newdelhi30-Jan-13 23:59 
GeneralRe: TCP Server: Render the image on server side Pin
Richard MacCutchan31-Jan-13 0:08
mvpRichard MacCutchan31-Jan-13 0:08 
AnswerRe: TCP Server: Render the image on server side Pin
Erudite_Eric30-Jan-13 4:13
memberErudite_Eric30-Jan-13 4:13 
GeneralRe: TCP Server: Render the image on server side Pin
Richard MacCutchan30-Jan-13 5:35
mvpRichard MacCutchan30-Jan-13 5:35 
GeneralRe: TCP Server: Render the image on server side Pin
Erudite_Eric30-Jan-13 6:01
memberErudite_Eric30-Jan-13 6:01 
GeneralRe: TCP Server: Render the image on server side Pin
toms from newdelhi30-Jan-13 17:47
membertoms from newdelhi30-Jan-13 17:47 
GeneralRe: TCP Server: Render the image on server side Pin
Erudite_Eric30-Jan-13 23:36
memberErudite_Eric30-Jan-13 23:36 
GeneralRe: TCP Server: Render the image on server side Pin
toms from newdelhi30-Jan-13 23:57
membertoms from newdelhi30-Jan-13 23:57 
GeneralRe: TCP Server: Render the image on server side Pin
Erudite_Eric31-Jan-13 22:35
memberErudite_Eric31-Jan-13 22:35 

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

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


Advertise | Privacy | Mobile
Web04 | 2.8.150520.1 | Last Updated 28 May 2015
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid