Click here to Skip to main content
15,886,873 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: How to fix Static contol width at run time? Pin
Le@rner13-Mar-13 1:25
Le@rner13-Mar-13 1:25 
AnswerRe: How to fix Static contol width at run time? Pin
Parthi_Appu13-Mar-13 1:47
Parthi_Appu13-Mar-13 1:47 
GeneralRe: How to fix Static contol width at run time? Pin
Le@rner13-Mar-13 2:01
Le@rner13-Mar-13 2:01 
QuestionCannot access #include files – “permission denied” [modified] Pin
Member 990306512-Mar-13 0:42
Member 990306512-Mar-13 0:42 
AnswerRe: Cannot access #include files – “permission denied” [modified] Pin
Richard MacCutchan12-Mar-13 1:11
mveRichard MacCutchan12-Mar-13 1:11 
AnswerRe: Cannot access #include files – “permission denied” [modified] Pin
Orjan Westin12-Mar-13 1:13
professionalOrjan Westin12-Mar-13 1:13 
QuestionRe: Cannot access #include files – “permission denied” [modified] Pin
Richard MacCutchan12-Mar-13 2:18
mveRichard MacCutchan12-Mar-13 2:18 
QuestionBitmap creation from a buffer recived Pin
Member 990306512-Mar-13 0:26
Member 990306512-Mar-13 0:26 
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);
AnswerRe: Bitmap creation from a buffer recived Pin
Richard MacCutchan12-Mar-13 1:13
mveRichard MacCutchan12-Mar-13 1:13 
Questionunable to register COM dll 64 bit Pin
Member 990306512-Mar-13 0:24
Member 990306512-Mar-13 0:24 
AnswerRe: unable to register COM dll 64 bit Pin
Richard MacCutchan12-Mar-13 1:15
mveRichard MacCutchan12-Mar-13 1:15 
AnswerRe: unable to register COM dll 64 bit Pin
dusty_dex12-Mar-13 5:16
dusty_dex12-Mar-13 5:16 
QuestionPlay Media File Pin
Member 990306512-Mar-13 0:23
Member 990306512-Mar-13 0:23 
AnswerRe: Play Media File Pin
Richard MacCutchan12-Mar-13 1:19
mveRichard MacCutchan12-Mar-13 1:19 
QuestionHow to find out if a file is loaded in memory? Pin
dliviu11-Mar-13 23:01
dliviu11-Mar-13 23:01 
AnswerRe: How to find out if a file is loaded in memory? Pin
CPallini11-Mar-13 23:27
mveCPallini11-Mar-13 23:27 
GeneralRe: How to find out if a file is loaded in memory? Pin
dliviu11-Mar-13 23:52
dliviu11-Mar-13 23:52 
GeneralRe: How to find out if a file is loaded in memory? Pin
CPallini11-Mar-13 23:58
mveCPallini11-Mar-13 23:58 
GeneralRe: How to find out if a file is loaded in memory? Pin
Stephen Hewitt16-Mar-13 13:34
Stephen Hewitt16-Mar-13 13:34 
GeneralRe: How to find out if a file is loaded in memory? Pin
CPallini17-Mar-13 5:09
mveCPallini17-Mar-13 5:09 
GeneralRe: How to find out if a file is loaded in memory? Pin
harold aptroot12-Mar-13 0:49
harold aptroot12-Mar-13 0:49 
GeneralRe: How to find out if a file is loaded in memory? Pin
dliviu12-Mar-13 0:54
dliviu12-Mar-13 0:54 
GeneralRe: How to find out if a file is loaded in memory? Pin
harold aptroot12-Mar-13 4:07
harold aptroot12-Mar-13 4:07 
GeneralRe: How to find out if a file is loaded in memory? Pin
Stephen Hewitt16-Mar-13 13:41
Stephen Hewitt16-Mar-13 13:41 
GeneralRe: How to find out if a file is loaded in memory? Pin
dliviu16-Mar-13 20:37
dliviu16-Mar-13 20:37 

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.