|
tasleem143 wrote: DWORD file=GetFileSize(handle,NULL);
Just curious, but do you supopose that someone three weeks from now will be able to discern that file represents the size of a file?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
i had changed that it was just the test code a part of program it was not final version code with variable.i just changed that on ur demand
top fileSize ,which was not my question its still on.
Tasleem Arif
|
|
|
|
|
tasleem143 wrote: unsigned char *Rbuff=new char[fileSize];
Why are you allocating char s for an unsigned char variable?
tasleem143 wrote: cout<<"\n Bitmap File header";
cout<<"\n"<<rbuff[i];< blockquote="">
Use endl instead of \n . Otherwise, cout 's caching will mess you up.
Is cout producing anything? If it looks like a memory address, you might need to cast it to a char ?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
tasleem143 wrote:
unsigned char *Rbuff=new char[fileSize];
sorry for this mistake,it was char* then i forget to replaced other side.
yes cout displays but these are fake char like BM p ? ( etc.
Tasleem Arif
|
|
|
|
|
tasleem143 wrote: fake char like BM p ?
Last time I checked, B, M, p, and ? were all real characters. What exactly are you referring to?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
i want to see the exact fields values present in the bitmapfileheader and bitmapfileinfo,when i read bit by bit from hard disk using fread etc then those values are not matched with the current i mean read through memory values i want that both should match so that i m confirmed that these r valid values from memory.
Tasleem Arif
|
|
|
|
|
tasleem143 wrote: i want to see the exact fields values present in the bitmapfileheader and bitmapfileinfo,when i read bit by bit from hard disk using fread...
So why aren't you doing something like:
CFile fileBitmap;
BITMAPFILEHEADER rBitmapFileHeader;
BITMAPINFOHEADER rBitmapInfoHeader;
fileBitmap.Open(strFilename, CFile::modeRead);
fileBitmap.Read(&rBitmapFileHeader, sizeof(BITMAPFILEHEADER));
fileBitmap.Read(&rBitmapInfoHeader, sizeof(BITMAPINFOHEADER));
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
thanks for replay!
i had done that b4 and it works,The purpose of reading from memory n displaying was that i want to confirm that bitmaps is correctaly copied in memory, and purpose of displaying through cout<< was that i m varified that both outputs are same, and if i perform the operations like changing its bits from memory then get the correct bits to change.
what i m doing i had read the file from disk through 2 methods
1.as u mentioned above and it works fine reading byte by byte or structure but this method is slow as i had to read the whole image byte by byte and it will take lot of time.
2.Through second method i m reading the whole image once not like byte by byte as method 1. i.e
file.read(buffer,filesize);
what i m doing is displaying the data using cout and confirming that both workd fine or not.
hope now u understood the situation.
Tasleem Arif
|
|
|
|
|
Is anyone kindly to tell me how can i save and resotre the child frames that last opened in a MDI program?
In the Main Frame,left side is a Tree Pane,when we selected a tree item and double click,it will create a corresponding child frame,The Child Frames are created dynamicly. When i close the program ,i need to save the status of the opened frame and open them the next time i start the program.
Is anybody can give me an example?
|
|
|
|
|
If I understood you want to save current status of your program you can save parameters to a file or on the registry and when you want to run your program first you read parameters and set your program to it.
|
|
|
|
|
How can A maximaze a dialog at runtime?
|
|
|
|
|
no need to reask
|
|
|
|
|
Is ShowWindow(SW_*) helpfuls ?
|
|
|
|
|
How can I at runtime maximaze a window?
|
|
|
|
|
use CWnd::ShowWindow(SW_SHOWMAXIMIZED);
|
|
|
|
|
Error on SW_MAXIMIZED way?
|
|
|
|
|
Larsson wrote: Error on SW_MAXIMIZED way?
what error ? i don't even understand your post...
|
|
|
|
|
If I use CWnd::ShowWindow(SW_MAXIMIZED);
I get;
error C2065: 'SW_MAXIMIZED' : undeclared identifier
Do I need to use something else?
|
|
|
|
|
fixed. use SW_SHOWMAXIMIZED instead...
|
|
|
|
|
|
toxcct wrote: use CWnd::ShowWindow(SW_MAXIMIZED);
Perhaps you meant SW_MAXIMIZE or SW_SHOWMAXIMIZED .
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
you're right, i typed from my head...
fixed now.
|
|
|
|
|
|
for example:
dlg.SendMessage(WM_SIZE,SIZE_MAXIMIZED,0);
you can try this.
|
|
|
|
|
I want to use Updatedata() in Thread function
I write the code below but compile error
UINT Thread1(LPVOID pParam)
{
CTestDlg *m_dlg = (CTestDlg*)pParam;
UpdateData(TRUE);//error
AfxMessageBox(m_dlg->m_edit);
return TRUE;
}
|
|
|
|