Sunday, January 17, 2016
EVC do not know CBitmap
I built a WCE Pocket PC 2003 Application of the project, the choice is the third one, is that helloworld. Then WndProc Riga sentence CBitmap pBitmap; compile pass
I also built a project is the WCE Pocket PC 2003 MFC AppWizard (exe), and all the way to next. Also add such a sentence, it is OK.
Then I compared the next two projects, there is no back a special file that contains
I do not understand.
Incidentally ask, the difference between these two projects, each of which has any use.
Reply:
Then carefully checked, we realized that the two projects are different StdAfx.h, after a project contains a afxdisp.h
Look at the name on that system files should be the same. . .
How, then, the first project to use bitmap?
The score fill bar, scores nothing
Reply:
Haha!
I grab geographical constituencies through direct landing!
However, according to the landlord said!
Helloword landlord has certainly not built MFC application it!
It should be win32;
But CBitmap is encapsulated MFC class, you can not use it under win32 course!
If you load and display a bitmap in win32 in, it would have the direct use of api!
Reply:
This is the code under win32, to the landlord wrote down, and he is familiar to some function!
HDC hDC, hMemDC;
HBITMAP hbitmap, hOldbitmap;
hDC = GetWindowDC (hWnd);
hMemDC = CreateCompatibleDC (hDC);
hbitmap = LoadBitmap (hInst, MAKEINTRESOURCE (IDB_BITMAP1));
hOldbitmap = (HBITMAP) SelectObject (hMemDC, hbitmap);
BitBlt (hDC, 100, 60, 200, 200, hMemDC, 0, 0, SRCCOPY);
SelectObject (hMemDC, hOldbitmap);
I have never written a few win32 program, get api function to load the Bitmap with size information is not found!
I hope this helps you a little bit!
Ha ha!
Reply:
It works very, huh
I have not written MFC programs, have been doing mobile games. Then ask the next: wm inside the game, usually with MFC, or WIN32
?
MFC convenient, but the file size is big, is not it. So, WIN32 what advantages it, it just is the file size small?
Reply:
Haha!
I just started learning Mobile development!
Using VS2005!
Previously been using VC!
Games I am not sure!
However, if the interface should be used MFC little more now! Easy points!
Develop a little more background applications with win32.
MFC framework comes with something much more than with win32, then it will take up more resources!
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment