Click here to Skip to main content
15,900,258 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralSetFocus to Formview..... Pin
22-May-01 12:07
suss22-May-01 12:07 
Generalwinmm.dll in win2000 - winNT - win9x Pin
22-May-01 11:00
suss22-May-01 11:00 
GeneralRe: winmm.dll in win2000 - winNT - win9x Pin
Tomasz Sowinski22-May-01 11:09
Tomasz Sowinski22-May-01 11:09 
GeneralNeed Help, HttpSendRequestEx Pin
Kaivalya Vishnu22-May-01 10:55
Kaivalya Vishnu22-May-01 10:55 
GeneralRe: Need Help, HttpSendRequestEx Pin
Anders Molin22-May-01 11:02
professionalAnders Molin22-May-01 11:02 
Generaladding vertical scroll to my dialog window. URGENT !!! Pin
22-May-01 10:09
suss22-May-01 10:09 
GeneralRe: adding vertical scroll to my dialog window. URGENT !!! Pin
Tomasz Sowinski22-May-01 10:17
Tomasz Sowinski22-May-01 10:17 
GeneralHelp needed, really bad Pin
mr200322-May-01 9:15
mr200322-May-01 9:15 
hi,
I have a SDI application, and I like to load a bmp file,
I got two functions in CView class.. but it just doesn't work.
can anyone see what the problem is..

void CTestEdgeView::OnFileOpen()
{
// TODO: Add your command handler code here

//build a filter to use in the file open dialo
static char BASED_CODE szFilter[] = "Bitmap Files (*.bmp) | *.bmp ||" ;

//Create the File open dialog
CFileDialog m_ldFile(TRUE, ".bmp", m_sBitmap,OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT,
szFilter);


//show the file open dialog capture the result
if (m_ldFile.DoModal() == IDOK )
{
Invalidate();
//get the filename selected
m_sBitmap = m_ldFile.GetPathName();

ShowBitmap( m_sBitmap);
}

}


void CTestEdgeView::ShowBitmap(CString file)
{

//check if we have a valid file
if(file !="")
{
HBITMAP hBitmap = (HBITMAP) ::LoadImage(AfxGetInstanceHandle(),
file, IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE | LR_CREATEDIBSECTION);

if (hBitmap)
{
// Delete the current bitmap
if (m_bmpBitmap.DeleteObject())
// If there was a bitmap, detach it
m_bmpBitmap.Detach();
// Attach the currently loaded bitmap to the bitmap object
m_bmpBitmap.Attach(hBitmap);
}
Invalidate(FALSE);
}
}


I appriciate your help.

Eek! | :eek:

Ehsan Behboudi
GeneralRe: Help needed, really bad Pin
Ravi Bhavnani22-May-01 10:47
professionalRavi Bhavnani22-May-01 10:47 
GeneralSHGetSpecialFolderLocation Pin
22-May-01 7:57
suss22-May-01 7:57 
GeneralRe: SHGetSpecialFolderLocation Pin
Michael Dunn22-May-01 8:17
sitebuilderMichael Dunn22-May-01 8:17 
GeneralHelp with WideCharToMultiByte Pin
Chris Meech22-May-01 6:25
Chris Meech22-May-01 6:25 
GeneralRe: Help with WideCharToMultiByte Pin
24-May-01 23:10
suss24-May-01 23:10 
GeneralDirect X Pin
Roger22-May-01 5:21
Roger22-May-01 5:21 
GeneralCHtmlView Pin
22-May-01 4:27
suss22-May-01 4:27 
GeneralRe: CHtmlView Pin
Tomasz Sowinski22-May-01 6:57
Tomasz Sowinski22-May-01 6:57 
GeneralRe: CHtmlView Pin
Carlos Antollini22-May-01 7:56
Carlos Antollini22-May-01 7:56 
GeneralRe: The other way is .... Pin
Masaaki Onishi22-May-01 15:46
Masaaki Onishi22-May-01 15:46 
GeneralSTL & List Control Pin
Derek Price22-May-01 4:25
Derek Price22-May-01 4:25 
General500% perf improvement in Release build? Pin
Tomasz Sowinski22-May-01 4:39
Tomasz Sowinski22-May-01 4:39 
GeneralRe: 500% perf improvement in Release build? Pin
Derek Price22-May-01 4:57
Derek Price22-May-01 4:57 
GeneralRe: 500% perf improvement in Release build? Pin
Tomasz Sowinski22-May-01 6:26
Tomasz Sowinski22-May-01 6:26 
GeneralRe: STL & List Control Pin
Chris Losinger22-May-01 6:03
professionalChris Losinger22-May-01 6:03 
GeneralRe: STL & List Control Pin
Derek Price22-May-01 6:19
Derek Price22-May-01 6:19 
GeneralRe: STL & List Control Pin
Tomasz Sowinski22-May-01 6:36
Tomasz Sowinski22-May-01 6:36 

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.