14291 views|32 replies

1

Posts

0

Resources
The OP

Using evc to display the bitmap does not work. [Copy link]

int CCText2View::OnCreate(LPCREATESTRUCT lpCreateStruct) { if (CView::OnCreate(lpCreateStruct) == -1) return -1; HWND hWnd; HBITMAP hBitmap; // static CBitmap bitmap; hBitmap=SHLoadDIBitmap((unsigned short *)"res\bitmap1.bmp"); // ((CBitmap*)hBitmap)->LoadBitmap(IDB_BITMAP1); CreateCaret(hWnd,hBitmap,50,20); ShowCaret(); return 0; } void CCText2View::OnLButtonDown(UINT nFlags, CPoint point) { SetCaretPos(point); CView::OnLButtonDown(nFlags, point); }
This post is from Embedded System

Latest reply

Hehe, the OP has confused Res and simulator. Upload the photo to the directory of your simulator. EVC comes with a copy tool to exchange data between the simulator and PC.  Details Published on 2010-5-21 22:05

1

Posts

0

Resources
2
In addition, I use the simulator that comes with evc.
This post is from Embedded System

1

Posts

0

Resources
3
I know what's wrong. To get the handle of the current window, use GetSafeHwnd() to get
This post is from Embedded System

2

Posts

0

Resources
4
But the problem now is that the hBitmap obtained by hBitmap=SHLoadDIBitmap((unsigned short *)"res\bitmap1.bmp") is empty. How to get the handle of the bitmap?
This post is from Embedded System

1

Posts

0

Resources
5
Push up the score
This post is from Embedded System

1

Posts

0

Resources
6
The full path must be used under CE, which means that the path of your image file is wrong!!
This post is from Embedded System

1

Posts

0

Resources
7
Yes, I also think it is wrong. I have tried many different path names but none of them are correct. hBitmap=SHLoadDIBitmap's hBitmap is always empty. On my computer (real machine), my image is in the path C:\\Program Files\\Microsoft eMbedded C++ 4.0\\Common\EVC\\MyProjects\\CText2\\res\\bitmap1.bmp. Can I put this path into SHLoadDIBitmap()? Should I use "\\" or "\"? I saw some root path on the Internet. The file name of my bmp file is res\bitmap1.bmp. What does this have to do with the so-called root path?
This post is from Embedded System

81

Posts

0

Resources
8
On the device or simulator, the path starts with :\\ and there can't be a drive letter!
This post is from Embedded System

2

Posts

0

Resources
9
On my programming PC, the path of the bmp file I imported is C:\\Program Files\\Microsoft eMbedded C++ 4.0\\Common\EVC\\MyProjects\\CText2\\res\\bitmap1.bmp. When I run the program on the wince virtual machine that comes with evc, I still can't get the image after I remove the C and start with :\\. . . .
This post is from Embedded System

1

Posts

0

Resources
10
If you put it in the Windows directory, it is \\Windows
This post is from Embedded System

1

Posts

0

Resources
11
joyzml Do you mean that when the bmp file is placed on a Windows XP system, the path in the SHLoadDIBitmap() function should use \\?
This post is from Embedded System

1

Posts

0

Resources
12
Are you talking about the path on the wince simulator or the path where the bmp is stored on your own computer (real machine)?
This post is from Embedded System

1

Posts

0

Resources
13
file:///C:/Documents%20and%20Settings/Administrator/Desktop/QQ screenshot unnamed.png This is the location of the bmp file in my project. Is the bmp file in this place?
This post is from Embedded System

3

Posts

0

Resources
14
BMP can only be placed on the device or simulator, and cannot specify a directory on the PC
This post is from Embedded System

1

Posts

0

Resources
15
For example, my project name is CText2 and the bmp file is bitmap1.bmp. When I run the project, I need to download it to the simulator. Should the path be: \\CText2\bitmap1.bmp?
This post is from Embedded System

81

Posts

0

Resources
16
CText only works on My Computer
This post is from Embedded System

4

Posts

0

Resources
17
I would like to add that after importing the bmp file, right-click and you can see that the filename edit box says res\bitmap1.bmp, right? Is it: \\CText2\res\bitmap1.bmp? But this doesn't work either.
This post is from Embedded System

1

Posts

0

Resources
18
The image must be on the device or simulator, and it has nothing to do with the directory on the PC.
This post is from Embedded System

1

Posts

0

Resources
19
Why can't I find the bitmap1.bmp file in the virtual machine? Is it in the exe file?
This post is from Embedded System

1

Posts

0

Resources
20
91program Can you give me an example, for example, bitmap1.bmp, in evc it is in the Bitmap file, but where is it in the simulator when the program is running? If it is in the Windows folder, what is the format of the path? I don't have an evc book, there are many types of it mentioned on the Internet, can you give me a standard answer?
This post is from Embedded System

Guess Your Favourite
Just looking around
Find a datasheet?

EEWorld Datasheet Technical Support

Related articles more>>
    Copyright © 2005-2025 EEWORLD.com.cn, Inc. All rights reserved 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号
    快速回复 返回顶部 Return list