Many newbie contacts WM and will not be able to find resources (especially images, files, and so on). Here I would like to introduce this simple knowledge:
1. WM originated from wince. In the file system, only the root directory \ and the full path relative to the root directory, such as \ Program Files \ A \ B .txt
Therefore, when reading files or other resources, you must first understand your path and check whether the resource is correct.
2. In the. net cf project, it is relatively simple to deploy resources to the corresponding simulators or devices.
The specific operation is: Add resources to your project (or simply CTR-V), and right-click your resources-> propertis (properties)-> copy to output dictionary, set this entry to copy always (always copy.
In this way, yourProgramWhen running (F5) or you take the initiative to deploy (deployment), resources will be copied to the deployment directory of the program.
3. In fact, this can also be implemented in the C/C ++ Project (by our boss ).
Right-click the project and choose propertis> Configuration Properties> deployment> additional files. You can add the file you want to add here. The syntax is as follows:
Name of the file to be deployed | directory where the file is located | where to deploy | 0
For example, if I want to deploy a.png under the res under the project directory to my project
A.png | $ (projectdir) \ res \ | % csidl_program_files % \ myproject | 0
If the syntax in your additional files is incorrect or the file cannot be found, the following error occurs in the output window of VC:
The system cannot find the specified file.Incorrect text. You need to check whether your file exists or not.
PS:
It can also be done in VC, but it is slightly more troublesome than C.