Click here to Skip to main content
15,898,938 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Sir, Can any One tell me what Message is Fired When We Press Atl+Ctrl+Del Pin
PJ Arends7-Dec-05 7:34
professionalPJ Arends7-Dec-05 7:34 
GeneralRe: Sir, Can any One tell me what Message is Fired When We Press Atl+Ctrl+Del Pin
David Crow7-Dec-05 7:45
David Crow7-Dec-05 7:45 
QuestionPrinting from an alternate paper tray Pin
rcraigadams7-Dec-05 4:08
rcraigadams7-Dec-05 4:08 
AnswerRe: Printing from an alternate paper tray Pin
ThatsAlok7-Dec-05 23:10
ThatsAlok7-Dec-05 23:10 
QuestionProblem With Message Handling in Modeless Dialog Pin
Doug Knudson7-Dec-05 3:35
Doug Knudson7-Dec-05 3:35 
QuestionSir , will any help me .i want menu with CheckBox . Pin
CodeVarma7-Dec-05 2:50
CodeVarma7-Dec-05 2:50 
GeneralRe: Sir , will any help me .i want menu with CheckBox . Pin
khan++7-Dec-05 3:59
khan++7-Dec-05 3:59 
QuestionHelp. Create a bmp file in C++ Pin
Ming Luo7-Dec-05 2:39
Ming Luo7-Dec-05 2:39 
Hi all:
I tried to sort out creating a bmp file and save an image in C++. It really annoyed me. Following is my test code, but it doesn't work. Could somebody give me an idea how to create a bmp file and store an image please????
Thanks!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

void draw(){
int x[100];
int n = 0;
for(int i = 0; i < 10; i ++){
for (int j = 0; j < 10; j ++){
x[i*10+j] = n++;
if (n >= 255) n = 0;
}
}
HBITMAP map = CreateBitmap(10, 10, 1, 8, x);
if (map == NULL) cout << "cao ni ma\n";

HANDLE hf; // file handle
BITMAPFILEHEADER hdr; // bitmap file-header
BITMAPINFOHEADER bih; // bitmap info-header
LPCTSTR filename = "output.bmp";
DWORD dwTmp;


hdr.bfSize = sizeof(BITMAPFILEHEADER)+sizeof(BITMAPINFOHEADER)+sizeof(x);

hdr.bfReserved1 = 0;
hdr.bfReserved2 = 0;
hdr.bfType = 0x4d42;
hdr.bfOffBits = sizeof(BITMAPFILEHEADER)+sizeof(BITMAPINFOHEADER);

bih.biSize = sizeof(BITMAPINFOHEADER);
bih.biWidth = 100;
bih.biHeight = 100;
bih.biPlanes = 1;
bih.biBitCount = 8;
bih.biCompression = BI_RGB;
bih.biSizeImage = 0;
bih.biXPelsPerMeter = 0;
bih.biYPelsPerMeter = 0;
bih.biClrUsed = 0;
bih.biClrImportant = 0;

hf = CreateFile(filename,
GENERIC_READ | GENERIC_WRITE,
(DWORD) 0,
NULL,
CREATE_ALWAYS,
FILE_ATTRIBUTE_NORMAL,
(HANDLE) NULL);
WriteFile(hf, &hdr, sizeof(BITMAPFILEHEADER),(LPDWORD) &dwTmp, NULL);
WriteFile(hf, &bih, sizeof(BITMAPINFOHEADER), (LPDWORD) &dwTmp, NULL);
WriteFile(hf, (LPSTR) x, 100, (LPDWORD) &dwTmp, NULL);
}




Asura
AnswerRe: Help. Create a bmp file in C++ Pin
jinzhecheng7-Dec-05 5:19
jinzhecheng7-Dec-05 5:19 
AnswerRe: Help. Create a bmp file in C++ Pin
Chris Losinger7-Dec-05 6:24
professionalChris Losinger7-Dec-05 6:24 
Questionhelp me to read serial number Pin
yasa2947-Dec-05 2:25
yasa2947-Dec-05 2:25 
AnswerRe: help me to read serial number Pin
kakan7-Dec-05 2:38
professionalkakan7-Dec-05 2:38 
GeneralRe: help me to read serial number Pin
ThatsAlok7-Dec-05 18:21
ThatsAlok7-Dec-05 18:21 
GeneralRe: help me to read serial number Pin
kakan7-Dec-05 18:44
professionalkakan7-Dec-05 18:44 
AnswerRe: help me to read serial number Pin
ThatsAlok7-Dec-05 18:21
ThatsAlok7-Dec-05 18:21 
QuestionHow to check the status of a Windows Service programatically Pin
amigo_rk7-Dec-05 2:11
amigo_rk7-Dec-05 2:11 
AnswerRe: How to check the status of a Windows Service programatically Pin
David Crow7-Dec-05 2:45
David Crow7-Dec-05 2:45 
AnswerRe: How to check the status of a Windows Service programatically Pin
ThatsAlok7-Dec-05 18:09
ThatsAlok7-Dec-05 18:09 
QuestionPrinting Extended Characters Pin
rcraigadams7-Dec-05 2:00
rcraigadams7-Dec-05 2:00 
QuestionHow to use Home &amp; End Buttons on TabControl Pin
zxc897-Dec-05 1:40
zxc897-Dec-05 1:40 
AnswerRe: How to use Home &amp; End Buttons on TabControl Pin
khan++7-Dec-05 4:06
khan++7-Dec-05 4:06 
QuestionIncluding the lib file Pin
vikas amin7-Dec-05 1:31
vikas amin7-Dec-05 1:31 
AnswerRe: Including the lib file Pin
Matt Godbolt7-Dec-05 1:50
Matt Godbolt7-Dec-05 1:50 
GeneralRe: Including the lib file Pin
vikas amin7-Dec-05 2:06
vikas amin7-Dec-05 2:06 
GeneralRe: Including the lib file Pin
Matt Godbolt7-Dec-05 4:22
Matt Godbolt7-Dec-05 4:22 

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.