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

C / C++ / MFC

 
QuestionRegQueryValueEx returns wrong value Pin
vks1125-May-14 23:57
vks1125-May-14 23:57 
AnswerRe: RegQueryValueEx returns wrong value Pin
Richard MacCutchan26-May-14 0:26
mveRichard MacCutchan26-May-14 0:26 
GeneralRe: RegQueryValueEx returns wrong value Pin
vks1126-May-14 23:24
vks1126-May-14 23:24 
AnswerRe: RegQueryValueEx returns wrong value Pin
Freak3026-May-14 3:13
Freak3026-May-14 3:13 
GeneralRe: RegQueryValueEx returns wrong value Pin
vks1126-May-14 23:23
vks1126-May-14 23:23 
AnswerRe: RegQueryValueEx returns wrong value Pin
Randor 26-May-14 14:06
professional Randor 26-May-14 14:06 
GeneralRe: RegQueryValueEx returns wrong value Pin
vks1126-May-14 23:23
vks1126-May-14 23:23 
GeneralProblem in reading BMP Header Pin
Benjamin Bruno25-May-14 19:03
Benjamin Bruno25-May-14 19:03 
Hi,
I'm trying to read a BMP image, the code is as follows. If i'm using a value 820 as BMP_HEADER_SIZE, my program works fine. I tried calculating the BMP_HEADER_SIZE value by summing the size of structure tagBITMAPFILEHEADER and tagBITMAPINFOHEADER (from BMP header file) but the program is not working. How can i solve this?

Class BlockinessProc.

# define BMP_HEADER_SIZE 820

void ReadImage(const char* filename);

char m_info[BMP_HEADER_SIZE];

unsignedchar** m_memblock;

void Blockinessproc::ReadImage(const char* filename)// Reading a BMP Image
{

streampos size;
ifstream inFile;

inFile.open(filename, ios::in|ios::binary);


if (inFile.is_open())
{

inFile.seekg (0, ios::beg);

long nHeaderSize = sizeof(BITMAPFILEHEADER) + sizeof(BITMAPINFOHEADER);

inFile.read ((char*)m_info, nHeaderSize);

width = *(int*)&m_info[18]; //Getting Image width from Header
height = *(int*)&m_info[22];// Getting Image height from Header



long pos = inFile.tellg();

m_memblock = new uchar* [width];
m_memblock_out = new uchar* [width];
for (int i = 0; i < height; i++) // create new array size: height of image.
{
m_memblock[i] = new uchar [width*3];
m_memblock_out[i] = new uchar [width*3];
}
int size_s = inFile.gcount();
inFile.seekg (pos);

for(int i=0; i<height; i++)="" read="" row="" into="" each="" array="" entry.
="" {

="" infile.read="" (reinterpret_cast<char*="">(m_memblock[i]), width*3);
}

inFile.close();
}
}

Thanks in Advance
GeneralRe: Problem in reading BMP Header Pin
Richard MacCutchan25-May-14 21:48
mveRichard MacCutchan25-May-14 21:48 
GeneralRe: Problem in reading BMP Header Pin
Heng Xiangzhong26-May-14 15:11
Heng Xiangzhong26-May-14 15:11 
GeneralRe: Problem in reading BMP Header Pin
CPallini26-May-14 22:01
mveCPallini26-May-14 22:01 
QuestionC Makefile warning: passing arg 2 of 'connect' from incompatible pointer type Pin
Office 36525-May-14 17:03
Office 36525-May-14 17:03 
AnswerRe: C Makefile warning: passing arg 2 of 'connect' from incompatible pointer type Pin
Richard MacCutchan25-May-14 21:43
mveRichard MacCutchan25-May-14 21:43 
GeneralRe: C Makefile warning: passing arg 2 of 'connect' from incompatible pointer type Pin
Office 36525-May-14 22:37
Office 36525-May-14 22:37 
GeneralRe: C Makefile warning: passing arg 2 of 'connect' from incompatible pointer type Pin
Richard MacCutchan25-May-14 22:52
mveRichard MacCutchan25-May-14 22:52 
GeneralRe: C Makefile warning: passing arg 2 of 'connect' from incompatible pointer type Pin
Office 36526-May-14 0:14
Office 36526-May-14 0:14 
GeneralRe: C Makefile warning: passing arg 2 of 'connect' from incompatible pointer type Pin
Richard MacCutchan26-May-14 0:23
mveRichard MacCutchan26-May-14 0:23 
GeneralRe: C Makefile warning: passing arg 2 of 'connect' from incompatible pointer type Pin
Office 36526-May-14 18:48
Office 36526-May-14 18:48 
GeneralRe: C Makefile warning: passing arg 2 of 'connect' from incompatible pointer type Pin
Richard MacCutchan26-May-14 21:33
mveRichard MacCutchan26-May-14 21:33 
QuestionGNU Gettext and windows localization Pin
Member 854422623-May-14 16:31
Member 854422623-May-14 16:31 
AnswerRe: GNU Gettext and windows localization Pin
Richard MacCutchan23-May-14 21:40
mveRichard MacCutchan23-May-14 21:40 
QuestionCFormView in CDocktablePane or docking frame CMDIChildWndEx Pin
Member 1074879523-May-14 6:16
Member 1074879523-May-14 6:16 
SuggestionRe: CFormView in CDocktablePane or docking frame CMDIChildWndEx Pin
Richard MacCutchan23-May-14 7:46
mveRichard MacCutchan23-May-14 7:46 
GeneralRe: CFormView in CDocktablePane or docking frame CMDIChildWndEx Pin
Member 1074879523-May-14 8:56
Member 1074879523-May-14 8:56 
GeneralRe: CFormView in CDocktablePane or docking frame CMDIChildWndEx Pin
Richard MacCutchan23-May-14 11:36
mveRichard MacCutchan23-May-14 11:36 

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.