Google Answers Logo
View Question
 
Q: Display Changing Image In Flex Grid Cell in Visual C++ ( No Answer,   0 Comments )
Question  
Subject: Display Changing Image In Flex Grid Cell in Visual C++
Category: Computers > Programming
Asked by: venura-ga
List Price: $2.00
Posted: 24 Jun 2004 05:02 PDT
Expires: 24 Jul 2004 05:02 PDT
Question ID: 365545
Hi 

I am using MSFlexGrid in Visual C++ .Net enviournment  to display
Images in it cells, Displaying images working fine. But when I am
changing images in cells frequently, after some time images getting
disapear. I am using following code
to display an image in my flex grid.
I am passing following arguments to my function
1) pointer to my flex grid
2) Column number
3) Row Number
4) Image Resource ID
5) Text string (to display if needed in top of the image in given cell)
===========================================================================
void CNTBCommon::setImage(CMsflexgrid * flxGrid, int iCol, int iRow,
UINT uiImageID,CString strDisplayText)
{
	IDispatch *pDisp;
	PICTDESC pictDesc;
	memset(&pictDesc, 0, sizeof(pictDesc));
	pictDesc.cbSizeofstruct = sizeof(pictDesc);
	pictDesc.bmp.hpal = 0;

	HBITMAP hBmp = (HBITMAP)::LoadImage(AfxGetInstanceHandle(), 
                                        MAKEINTRESOURCE(uiImageID),
                                        IMAGE_BITMAP, 
                                        0,0, 
                                        LR_LOADMAP3DCOLORS);

	pictDesc.bmp.hbitmap = hBmp;
	pictDesc.picType = PICTYPE_BITMAP;

	HRESULT hr = OleCreatePictureIndirect(&pictDesc, 
											IID_IDispatch, 
											FALSE, 
											(void**)&pDisp);

	if(SUCCEEDED(hr)&&SUCCEEDED(hr1))
	{
		flxGrid->put_Col(iCol);
		flxGrid->put_Row(iRow);
		flxGrid->putref_CellPicture(pDisp);
		pDisp->Release();
		flxGrid->put_TextMatrix(iRow,iCol,strDisplayText); 
		flxGrid->UpdateWindow();
	}
}
======================================================
thank you
venura
Answer  
There is no answer at this time.

Comments  
There are no comments at this time.

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy