1. String (STL) and _BSTR_T transformation _STR is _BSTR_T variable method 1: Environment settings contain header file comutil.h in setting Link Add to COMSUPP.LIB STR = _COM_UTIL :: ConvertBSTRTSTRING (_STR); method 2: Const char * buf = _str; string str = buf; ======================================================= 2, Set the header file and source file, the path to the lib file in Tools-Options-Directory! ================================= in the MFC program: class cframewnd {hwnd hwnd; public; public : CframeWnd (); Virtual ~ frameWnd (); int create (); bool showWnd ();}; class cwinapp {public: cframeWnd * m_pmainwnd; // is generated by WinApp. . Call CREATE to generate this frameWnd cwinapp * m_pcurrentwinapp cwinapp (); Virtual ~ cwinapp (); Virtual Bool InitInstance (); Virtual Bool Run ();} There is also a main function, declare a global WinApp as a global WINAPP outside the main function Point, in the main function, you get this WINAPP instance. InitInstance is called with this WINAPP to generate an instance of CFraMewnd, implement the CFrameWnd's Create and ShowWnd, and use WinApp's Run function to realize the monitoring, For example, simple messages such as the closure of the window.
============================ 4, the connection error: (source program at http://dev.9cbs.net/Article/64 /article/63/63588.shtm)Linking...LIBCD.lib(crt0.obj): error LNK2001: unresolved external symbol _mainDebug / Text2.exe: fatal error LNK1120: 1 unresolved externalsError executing link.exe.Text2.exe - 2 Error (s), 0 Warning (s) What does it mean? ? Write WinMain into main to start the application startup running time Calling the entry point function Win32 console corresponds to the winmain problem: Where is the specific setting? ?