-
The reason for the problem is the difference between ANSI and Unicode encoding of strings, VC6 and VS2003 use ANSI encoding by default, while VS2005 uses Unicode by default
To put it simply, ANSI uses 1 byte for a character, and Unicode uses 2 bytes for 1 character.
If you want your ** to compile in VS2005, 3 methods:
1.Modifiable encoding options: Project Properties --> Configuration Properties --> General --> Character Set --> Use Multi-Byte Character Set.
2.Define your string as a wide string, for example:
-wchar szname[128] ;
-createwindow ( l"This is the class name",……Here l is defined as a wide string macro.
3.Specify the API version explicitly: change wndclass to wndclassa and createwindow to createwindowa.
For string-related APIs in Win32, there are generally two versions: ANSI version and Unicode version.
For example, createwindowa and createwindoww.
Usually it is not explicitly specified in use, if you use CreateWindow in VC6, the compiler will use version A, and if you use CreateWindow in VS2005, the compiler will use version W.
However, it can be explicitly specified during development.
-
"weixin";Instead"weixin";
You can change it like this: szclassname="weixin";
szclassname;
You have to understand that this is a pointer, and when you assign a value to it, it must point to a space that already makes sense, and that space is available to your program.
VS2005 is more C++ than VC6
That's it!
-
hwnd=createwindow("weixin2003","Beijing Restoration Science and Technology Training Center",ws_overlappedwindow,0,0,600,400,null,null,hinstance,null);
on"weixin2003"Convert it again (lpcwstr)."weixin2003"
Either there is a cstring class (cstringt) directly
-
The default encoding method in VS2005 is Unicode, which is incompatible with your writing method. Adding the character "l" in front of the appearance of the string is sufficient. For example: l"weixin".
-
Question 2, the source ** needs to be supported by the workspace. Win32 Application is (Win32 API). The so-called project is just a combination of many sources.
At compile time, all files are compiled into the corresponding *o, when building, connect them, and then connect them with system libraries (such as MFC) to combine them into a hidden executable.
Question three...OPT should say that chaining is a temporary control, and any changes to the project are saved here, unless you save the file.
plg is the "log" generated when a connection is compiled
obj is the object file that is compiled.
PDB and PCH are files that are required for compilation.
-
The first problem is mainly: there is a difference between closing a window and ending an application.
-
From the perspective of the window mechanism of the Windows system, there are at least three steps:
1. Registration window class.
2. Use the createwindow createwindowex() API to create a window.
3. Implement the ** function of the message event defined in the window class.
If you want to create a registered window (such as some window types provided by the system, such as boxes, tree lists, etc.), you don't need to register the window class, you can create it directly through createwindowex(), and you don't need to process the window's event messages. If you need to handle these messages yourself, then this is a technical concept called subclassing or superclassing.
If it's an implementation dialog, it's simpler. Dialog is a special type of window, you need to define a dialog template in the resource now, and then create it directly through APIs such as DialogBoxParam DialogBoxInDirectParam().
In terms of implementation:
1. SDK programming, then you need to manually code according to your needs, and handle these steps according to your needs.
2. Based on the ATL framework, directly create a template class based on the <> CwindowIMPL, and inherit and implement a class instance to process the message chain. Then create a class instance where you need it, and call the create() method of the class instance.
3. Based on the MFC framework, directly create a cwnd CDilog class based on the inheritance implementation class instance to process the message chain. The principle is similar to ATL, except that the implementation is not quite the same.
ATL-based MFC frameworks can be created through VS wizards, and the principle is the same, which is nothing more than eliminating most of the manual code typing process.
-
Open the application > create > mfc appvizard [exe] (enter the project name and select the path) > based dialog box (click to complete without clicking to select other items) > complete.
Why do people live?
Just saw it from The Reader. >>>More
Early periods do not affect the safe period. According to the day you said, the 21st ML is within the safe period. It is not possible to get pregnant during the safe period, but the premise is that the safe period contraceptive method is only suitable for women who have a stable period. >>>More
Create a database.
Select the Program Management SQL Server 2008 SQL Server Management Studio command in the Start menu to open the SQL Server Management Studio window and establish a connection using Windows or SQL Server authentication. >>>More
#include
using namespace std; >>>More
Why do you use arrays for this?
It's okay to use loops. >>>More