Archived

This topic is now archived and is closed to further replies.

Newbie Question: CreateClipper problem

This topic is 6361 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hey, Well whenever I call CreateClipper I get an INVALID_OBJECT error. Could someone tell me whats wrong, here is the code for the create clipper:
        

LPDIRECTDRAWCLIPPER   lpddclipper; // Clipper

LPRGNDATA             clipper; // Pointer to region data that contains header and clip list.




        ddrval = lpDD->CreateClipper(0, &lpddclipper, NULL); 
	switch(ddrval) {

	case DDERR_INVALIDOBJECT: 
		MessageBox(hwnd, "no dude 1", "", MB_OK);
		break;
	case DDERR_INVALIDPARAMS:  
		MessageBox(hwnd, "no dude 2", "", MB_OK);
		break;
	case DDERR_NOCOOPERATIVELEVELSET:
		MessageBox(hwnd, "no dude 3", "", MB_OK);
		break;
	case DDERR_OUTOFMEMORY:  
		MessageBox(hwnd, "no dude 4", "", MB_OK);
		break;
	}


	

	clipper = (LPRGNDATA)malloc(sizeof(RGNDATAHEADER)+1*sizeof(RECT));

	clipper->rdh.dwSize = sizeof(RGNDATAHEADER);
	clipper->rdh.iType = RDH_RECTANGLES;
	clipper->rdh.nCount = 1;
	clipper->rdh.nCount = 1 * sizeof(RECT);

	clipper->rdh.rcBound.top = 0;MessageBox(hwnd, "no dude 1", "", MB_OK);
	clipper->rdh.rcBound.left = 0;
	clipper->rdh.rcBound.right = 640;
	clipper->rdh.rcBound.bottom = 480;

	if(FAILED(lpddclipper->SetClipList(clipper, 0))) {

		MessageBox(hwnd, "no dude 2", "", MB_OK);
	}
	if(FAILED(lpDDSBack->SetClipper(lpddclipper))) {

		MessageBox(hwnd, "no dude 3", "", MB_OK);
	}

	free(clipper);

        
Well if someone could help me I would like that, Thanks. James, Later Edited by - JSCFaith on 7/16/00 12:58:49 PM

Share this post


Link to post
Share on other sites