I've deleted Open from my file menu and placed my own Open BMP instead and it works fine in my MFC CScrollView SDI app. My OpenBMP function gets the filename from the user; then in OnDraw, I load and display the bitmap.
However, "Open With" (on the context menu) does not work, so I used the bitmap filename found in the command line argument (m_lpCmdLine) and tried to open the file the same way. ((HBITMAP)::LoadImage) returns NULL and concurrently a Windows error message pops up saying windows is unable to find the file.The error message includes the full path to the file including the filename and it is correct. Also, the filename I'm passing to LoadImage is correct. The same LoadImage code is used successfully when opening a file from my Open BMP function. The bitmap file I'm trying to open is on a local drive.
Any advice? Is there a better way to do this?
Regards,
Lowell.




The error message includes the full path to the file including the filename and it is correct. Also, the filename I'm passing to LoadImage is correct. The same LoadImage code is used successfully when opening a file from my Open BMP function. The bitmap file I'm trying to open is on a local drive.
Reply With Quote