Click here to Skip to main content
15,892,059 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: resetting cprogressbar to zero Pin
parchibald29-Dec-08 7:47
parchibald29-Dec-08 7:47 
GeneralRe: resetting cprogressbar to zero Pin
Mark Salsbery29-Dec-08 6:12
Mark Salsbery29-Dec-08 6:12 
QuestionChanging Windows Vista control panel settings (control panel>ease of access center>optimize visual display>make the focus rectangle thicker) Pin
tony_Udz28-Dec-08 19:08
tony_Udz28-Dec-08 19:08 
AnswerRe: Changing Windows Vista control panel settings (control panel>ease of access center>optimize visual display>make the focus rectangle thicker) Pin
Hamid_RT28-Dec-08 19:30
Hamid_RT28-Dec-08 19:30 
GeneralRe: Changing Windows Vista control panel settings (control panel>ease of access center>optimize visual display>make the focus rectangle thicker) Pin
tony_Udz28-Dec-08 19:48
tony_Udz28-Dec-08 19:48 
QuestionHow to retrofit C++ app to support B/S? Pin
kuibing28-Dec-08 19:01
kuibing28-Dec-08 19:01 
AnswerRe: How to retrofit C++ app to support B/S? Pin
Richard Andrew x6428-Dec-08 23:47
professionalRichard Andrew x6428-Dec-08 23:47 
QuestionUnable to Load Image Other than .bmp by LoadImage Function? [modified] Pin
Le@rner28-Dec-08 18:09
Le@rner28-Dec-08 18:09 
HI all,

i m using LoadImage function to load image for printing.

i u using this.

CDC* pDC;
CPrintInfo* pInfo;
Cstring file_name;
CBitmap bitmap;
		  int maxw = pDC->GetDeviceCaps(HORZRES);
		  int maxh = pDC->GetDeviceCaps(VERTRES); 
		  pInfo->m_rectDraw.SetRect(0, 0, maxw, maxh); 

		  // LoadImage does the trick here, it creates a DIB section
		  // You can also use a resource here
		  // by using MAKEINTRESOURCE() ... etc. 
		  if(!bitmap.Attach(::LoadImage(
		  ::GetModuleHandle(NULL), file_name, IMAGE_BITMAP, 0, 0, 
		  LR_LOADFROMFILE | LR_CREATEDIBSECTION | LR_DEFAULTSIZE))) 
		  {
			AfxMessageBox(_T("Error loading bitmap!")); 
			return;
		  } 
		  BITMAP bm;
		  bitmap.GetBitmap(&bm);
		  int w = bm.bmWidth; 
		  int h = bm.bmHeight; 
		  // create memory device context
		  CDC memDC; 
		  memDC.CreateCompatibleDC(pDC);
		  CBitmap *pBmp = memDC.SelectObject(&bitmap);
		  memDC.SetMapMode(pDC->GetMapMode());
		  pDC->SetStretchBltMode(HALFTONE);
		  // now stretchblt to maximum width on page
		  pDC->StretchBlt(0, 0, maxw, maxh, &memDC, 0, 0, w, h, SRCCOPY); 
		  // clean up
		  memDC.SelectObject(pBmp);


its not able to load image.Please tell me how can i do this.

thanks in advance.

IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH

modified on Monday, December 29, 2008 12:40 AM

AnswerRe: Unable to Load Image Other than .bmp by LoadImage Function? Pin
Hamid_RT28-Dec-08 19:22
Hamid_RT28-Dec-08 19:22 
GeneralRe: Unable to Load Image Other than .bmp by LoadImage Function? Pin
Le@rner28-Dec-08 19:26
Le@rner28-Dec-08 19:26 
GeneralRe: Unable to Load Image Other than .bmp by LoadImage Function? Pin
Hamid_RT28-Dec-08 19:33
Hamid_RT28-Dec-08 19:33 
GeneralRe: Unable to Load Image Other than .bmp by LoadImage Function? [modified] Pin
Le@rner28-Dec-08 19:50
Le@rner28-Dec-08 19:50 
GeneralRe: Unable to Load Image Other than .bmp by LoadImage Function? Pin
Hamid_RT28-Dec-08 20:01
Hamid_RT28-Dec-08 20:01 
GeneralRe: Unable to Load Image Other than .bmp by LoadImage Function? Pin
Le@rner28-Dec-08 20:25
Le@rner28-Dec-08 20:25 
GeneralRe: Unable to Load Image Other than .bmp by LoadImage Function? Pin
Hamid_RT28-Dec-08 20:50
Hamid_RT28-Dec-08 20:50 
Questioncrash with vectors in Release Pin
VC++Maniac28-Dec-08 17:25
VC++Maniac28-Dec-08 17:25 
AnswerRe: crash with vectors in Release Pin
_AnsHUMAN_ 28-Dec-08 17:38
_AnsHUMAN_ 28-Dec-08 17:38 
GeneralRe: crash with vectors in Release Pin
VC++Maniac28-Dec-08 23:32
VC++Maniac28-Dec-08 23:32 
GeneralRe: crash with vectors in Release Pin
David Schumaker17-Feb-09 7:35
David Schumaker17-Feb-09 7:35 
GeneralRe: crash with vectors in Release Pin
Maximilien30-Jun-09 8:41
Maximilien30-Jun-09 8:41 
AnswerRe: crash with vectors in Release Pin
semitae11-Feb-10 1:26
semitae11-Feb-10 1:26 
QuestionHANDLE? Pin
dec8228-Dec-08 16:30
dec8228-Dec-08 16:30 
AnswerRe: HANDLE? Pin
Subrat 470826628-Dec-08 16:58
Subrat 470826628-Dec-08 16:58 
AnswerRe: HANDLE? Pin
Hamid_RT28-Dec-08 18:04
Hamid_RT28-Dec-08 18:04 
QuestionEvent driven, blocking Pipe for MFC? Pin
nobaq28-Dec-08 11:54
nobaq28-Dec-08 11:54 

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.