Click here to Skip to main content
15,912,756 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Is the Parent Instance Same For All Childs? Pin
Richard Andrew x6425-Aug-13 10:53
professionalRichard Andrew x6425-Aug-13 10:53 
AnswerRe: Is the Parent Instance Same For All Childs? Pin
SaqibRasheed25-Aug-13 11:33
SaqibRasheed25-Aug-13 11:33 
AnswerRe: Is the Parent Instance Same For All Childs? Pin
«_Superman_»25-Aug-13 20:37
professional«_Superman_»25-Aug-13 20:37 
QuestionCreateDIBSection() is failing Pin
ash_hdr24-Aug-13 17:56
ash_hdr24-Aug-13 17:56 
SuggestionRe: CreateDIBSection() is failing Pin
Richard MacCutchan24-Aug-13 21:26
mveRichard MacCutchan24-Aug-13 21:26 
GeneralRe: CreateDIBSection() is failing Pin
ash_hdr25-Aug-13 0:15
ash_hdr25-Aug-13 0:15 
GeneralRe: CreateDIBSection() is failing Pin
Richard MacCutchan25-Aug-13 0:45
mveRichard MacCutchan25-Aug-13 0:45 
GeneralRe: CreateDIBSection() is failing Pin
ash_hdr25-Aug-13 1:27
ash_hdr25-Aug-13 1:27 
The error code 8 I am getting at some other place in code while calling the function ::MapViewOfFile() and not while calling CreateDIBSection().
Following is the code snipet
C++
void create(const CSize& size)
{

	initBitmapInfo(size);

	mBitmap = ::CreateDIBSection(0, 
								 getBitmapInfo(), 
								 DIB_RGB_COLORS,	
								 (LPVOID*) &mBits, 
								 0, 
								 sizeof(BITMAPINFOHEADER));
	if (mBitmap == 0 || mBits == 0)
	{	
		cout << "NcSurface::destroy()-------- mBitmap = " << mBitmap<< endl;
		cout << "NcSurface::destroy()-------- mBits = " << mBits <<  endl;
		cout << "NcSurface::destroy()-------- size.cx  = " << size.cx <<  endl;
		cout << "NcSurface::destroy()-------- size.cy  = " << size.cy  <<  endl;
		ErrorInstance::instance()->throwError(__FILE__, __LINE__, GdiException());
	}

}
void initBitmapInfo(const CSize& size)
{
    BITMAPINFO* bmi = getBitmapInfo();
    CHECK(bmi != 0);

    bmi->bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
    bmi->bmiHeader.biWidth = size.cx;
    bmi->bmiHeader.biHeight = size.cy;
    bmi->bmiHeader.biPlanes = 1;
    bmi->bmiHeader.biBitCount = 24;
    bmi->bmiHeader.biCompression = BI_RGB;
    bmi->bmiHeader.biSizeImage = 0;
    bmi->bmiHeader.biXPelsPerMeter = 0;
    bmi->bmiHeader.biYPelsPerMeter = 0;
    bmi->bmiHeader.biClrUsed = 0;
    bmi->bmiHeader.biClrImportant = 0;
}

size.cx = 6000 and size.cy = 4000
GeneralRe: CreateDIBSection() is failing Pin
ash_hdr25-Aug-13 1:33
ash_hdr25-Aug-13 1:33 
GeneralRe: CreateDIBSection() is failing Pin
Richard MacCutchan25-Aug-13 1:39
mveRichard MacCutchan25-Aug-13 1:39 
GeneralRe: CreateDIBSection() is failing Pin
ash_hdr25-Aug-13 2:05
ash_hdr25-Aug-13 2:05 
GeneralRe: CreateDIBSection() is failing Pin
Richard MacCutchan25-Aug-13 2:45
mveRichard MacCutchan25-Aug-13 2:45 
GeneralRe: CreateDIBSection() is failing Pin
ash_hdr25-Aug-13 3:13
ash_hdr25-Aug-13 3:13 
GeneralRe: CreateDIBSection() is failing Pin
Richard MacCutchan25-Aug-13 3:25
mveRichard MacCutchan25-Aug-13 3:25 
GeneralRe: CreateDIBSection() is failing Pin
Richard MacCutchan25-Aug-13 1:37
mveRichard MacCutchan25-Aug-13 1:37 
GeneralRe: CreateDIBSection() is failing Pin
ash_hdr25-Aug-13 2:00
ash_hdr25-Aug-13 2:00 
GeneralRe: CreateDIBSection() is failing Pin
Richard MacCutchan25-Aug-13 2:41
mveRichard MacCutchan25-Aug-13 2:41 
GeneralRe: CreateDIBSection() is failing Pin
ash_hdr25-Aug-13 2:48
ash_hdr25-Aug-13 2:48 
GeneralRe: CreateDIBSection() is failing Pin
Richard MacCutchan25-Aug-13 2:51
mveRichard MacCutchan25-Aug-13 2:51 
GeneralRe: CreateDIBSection() is failing Pin
pasztorpisti25-Aug-13 2:13
pasztorpisti25-Aug-13 2:13 
GeneralRe: CreateDIBSection() is failing Pin
ash_hdr25-Aug-13 2:22
ash_hdr25-Aug-13 2:22 
GeneralRe: CreateDIBSection() is failing Pin
pasztorpisti25-Aug-13 5:46
pasztorpisti25-Aug-13 5:46 
GeneralRe: CreateDIBSection() is failing Pin
ash_hdr25-Aug-13 23:26
ash_hdr25-Aug-13 23:26 
GeneralRe: CreateDIBSection() is failing Pin
pasztorpisti25-Aug-13 23:43
pasztorpisti25-Aug-13 23:43 
GeneralRe: CreateDIBSection() is failing Pin
ash_hdr26-Aug-13 2:22
ash_hdr26-Aug-13 2: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.