Click here to Skip to main content
15,891,704 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: about send function!! Pin
Laurence5-Dec-07 1:45
Laurence5-Dec-07 1:45 
GeneralRe: about send function!! Pin
followait4-Dec-07 23:24
followait4-Dec-07 23:24 
GeneralRe: about send function!! Pin
ktm TechMan5-Dec-07 0:13
ktm TechMan5-Dec-07 0:13 
GeneralRe: about send function!! Pin
Laurence5-Dec-07 1:46
Laurence5-Dec-07 1:46 
GeneralR about send function!! Pin
Laurence5-Dec-07 1:50
Laurence5-Dec-07 1:50 
GeneralRe: about send function!! Pin
JudyL_MD5-Dec-07 2:33
JudyL_MD5-Dec-07 2:33 
GeneralRe: about send function!! Pin
Dexterus5-Dec-07 21:24
Dexterus5-Dec-07 21:24 
QuestionHow to catch GDI+ exceptions? [modified] Pin
followait4-Dec-07 22:08
followait4-Dec-07 22:08 
for example
try {
    Bitmap bmp(path);   //It is strange that the piece of code  works
                        //in my test app, when I copy it, it throw
                        //exception here. The code is totally local.
} catch (/*???*/) {
]



	CMainFrame *pMF=(CMainFrame *)AfxGetMainWnd();

	TCHAR Path[MAX_PATH];
	TCHAR FullPath[MAX_PATH];
	BROWSEINFO bi;
	::memset(&bi,0,sizeof(bi));
	bi.hwndOwner=m_hWnd;
	bi.pszDisplayName=Path;
	bi.lpszTitle=TEXT("Select a directory");
	bi.ulFlags=BIF_DONTGOBELOWDOMAIN|BIF_EDITBOX|BIF_NEWDIALOGSTYLE
		|BIF_NONEWFOLDERBUTTON|BIF_RETURNONLYFSDIRS|BIF_STATUSTEXT;
	LPCITEMIDLIST pidl=SHBrowseForFolder(&bi);
	if(::SHGetPathFromIDList(pidl,FullPath)) {
		int len=_tcslen(FullPath);
		CString s(FullPath);
		s+=TEXT("\\*.jpg");
		CFileFind ff;
		BOOL b=ff.FindFile(s);
		while (b) {
			b=ff.FindNextFile();
			CString FilePath=ff.GetFilePath();
			WCHAR *p=FilePath.AllocSysString();
			Gdiplus::Bitmap bmp(p);
			Gdiplus::Bitmap *pThmb=(Gdiplus::Bitmap*)bmp.GetThumbnailImage(60,45);
			HBITMAP hBmp;
			pThmb->GetHBITMAP(Color::Black,&hBmp); 
//Got exception in the previuos line, 
//pThumb is NULL and bmp seems not available when I check in debug


modified on Wednesday, December 05, 2007 4:15:58 AM

AnswerRe: How to catch GDI+ exceptions? Pin
SandipG 4-Dec-07 22:47
SandipG 4-Dec-07 22:47 
GeneralRe: How to catch GDI+ exceptions? Pin
followait4-Dec-07 23:00
followait4-Dec-07 23:00 
GeneralRe: How to catch GDI+ exceptions? Pin
SandipG 4-Dec-07 23:08
SandipG 4-Dec-07 23:08 
GeneralRe: How to catch GDI+ exceptions? Pin
followait4-Dec-07 23:18
followait4-Dec-07 23:18 
GeneralVC++ https Pin
mohindar_kks4-Dec-07 22:02
mohindar_kks4-Dec-07 22:02 
GeneralRe: VC++ https Pin
ThatsAlok4-Dec-07 23:33
ThatsAlok4-Dec-07 23:33 
GeneralRe: VC++ https Pin
mohindar_kks5-Dec-07 0:13
mohindar_kks5-Dec-07 0:13 
Generalconverting LPCSTR to char* Pin
neha.agarwal274-Dec-07 21:27
neha.agarwal274-Dec-07 21:27 
GeneralRe: converting LPCSTR to char* Pin
Cedric Moonen4-Dec-07 21:30
Cedric Moonen4-Dec-07 21:30 
GeneralRe: converting LPCSTR to char* Pin
CPallini4-Dec-07 21:44
mveCPallini4-Dec-07 21:44 
GeneralRe: converting LPCSTR to char* Pin
Don Box4-Dec-07 21:47
Don Box4-Dec-07 21:47 
GeneralRe: converting LPCSTR to char* Pin
ThatsAlok4-Dec-07 22:16
ThatsAlok4-Dec-07 22:16 
GeneralRe: converting LPCSTR to char* Pin
jhwurmbach4-Dec-07 22:31
jhwurmbach4-Dec-07 22:31 
GeneralRe: converting LPCSTR to char* Pin
ThatsAlok4-Dec-07 23:32
ThatsAlok4-Dec-07 23:32 
GeneralRe: converting LPCSTR to char* Pin
sarat4-Dec-07 23:19
sarat4-Dec-07 23:19 
GeneralRe: converting LPCSTR to char* Pin
sarat4-Dec-07 23:20
sarat4-Dec-07 23:20 
GeneralRe: converting LPCSTR to char* Pin
Cedric Moonen4-Dec-07 23:33
Cedric Moonen4-Dec-07 23:33 

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.