VC + + Note 11

Source: Internet
Author: User

One, LNK1123: failed during transition to COFF: invalid or corrupt file
The connector LNK is converted to the COFF format by calling the Cvtres.exe complete file, so this error occurs because of a problem with Cvtres.exe.


Search the computer inside Cvtres.exe, found that there are multiple files, using the latest Cvtres.exe replace the old files. Remember to back it up before you replace it, assuming it is incorrect and can be replaced.


For example: My Computer installed VS2010, recently updated the system. Hit some patches. The result is such a mistake. Search in the computer found
C:\Program Files\Microsoft Visual Studio 10.0\vc\bin
C:\Windows\winsxs\x86_netfx-cvtres_for_vc_and_vb_b03f5f7f11d50a3a_6.1.7600.16385_none_ba476986f05abc65
C:\Windows\Microsoft.NET\Framework\v4.0.30319


There are cvtres.exe files in all three paths, so I try to replace the first path file with the one in the second path. Problem solving.
//////////////////////////////////////////////////////////
VS2010 Compile Error: fatal error C1189: #error: This file requires _win32_winnt to is #defined at least to 0x0403. Value 0x0501 or higher
Monkey Monkey 2012-07-12 17:35:24
VS2010 Compile Error: fatal error C1189: #error: This file requires _win32_winnt to is #defined at least to 0x0403. Value 0x0501 or higher
Category: VC 2010-08-13 16:09 3665 people Read reviews (0) Favorite reports
Here's a thorough workaround:
Add in Project StdAfx.h (if you have a similar statement, you need to stare out)
#ifndef WINVER//allow use of the features specific to Windows and Windows NT 4 or later.
#define WINVER 0x0501//change this to the appropriate value to target Windows 98 and Windows $ or later.
#endif


#ifndef _WIN32_WINNT//allow use of features specific to Windows NT 4 or later.
#define _WIN32_WINNT 0x0501//change this to the appropriate value to target Windows 98 and Windows $ or later.
#endif


#ifndef _win32_windows//allow use of features specific to WINDOWS 98 or later.
#define _win32_windows 0x0501//change for the appropriate value to target WINDOWS Me or later.
#endif


#ifndef _win32_ie//allow use of the features specific to IE 4.0 or later.
#define _WIN32_IE 0x0601//change this to the appropriate value to target IE 5.0 or later.
#endif
//////////////////////////////////////////////////////////////////////////
The comparison between BitBlt and StretchBlt
Their difference is that one can not be arbitrarily changed size, a size casually change.
///////////////////////////////////////////////////////
Add the following code to CMainFrame's OnCreate (), for example:


Long Style;
Remove title bar and other styles
SetWindowLong (this->m_hwnd,gwl_style,0);


Remove borders and other styles
SetWindowLong (this->m_hwnd,gwl_exstyle,0);


Cancel the menu bar
This->setmenu (NULL);


The border is also removed from the OnCreate () in CView


Remove border style and other styles
Long Style;
SetWindowLong (this->m_hwnd,gwl_exstyle,0);








Method Two: Using CWnd member function ModifyStyle implementation
Hide TitleBar
ModifyStyle (ws_caption, 0, swp_framechanged);
Show TitleBar
ModifyStyle (0, Ws_caption, swp_framechanged);


The above code, placed in the tail of the CMainFrame oncreate function can ~ ~
///////////////////////////////////////////////////////
SendDlgItemMessage function Function: This function sends a message to the control in the specified dialog box.




Function prototype: LONG senddlgitemmessage (
HWND hdlg,//Handle of dialog box
int Niddlgitem,//identifier of control
UINT MSG,//message to send
WPARAM WPARAM,//First message parameter
LPARAM LPARAM//second message parameter
);
Number of references:
Hdlg: Specifies a dialog box that contains controls.
Niddigitem: Specifies the identifier of the control that receives the message.


MSG: Specifies the message that will be sent.
WParam: Specifies additional information specific to the message.
LParam: Specifies additional information specific to the message.
Return value: The return value specifies the result of the message processing and depends on the message being sent.


Note: The SendDlgItemMessage function is not returned until the message has been processed.
Use the SendDlgItemMessage function to retrieve a handle from a specified control and call the Sendmessagge function.


///////////////////////////////////////////////////////////////////////////////
The RegisterWindowMessage function defines a new form message that guarantees that the message is unique within the system scope. The message value returned by the function can be used when the SendMessage or PostMessage function is usually called.

VC + + Note 11

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.