久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

  • <legend id='SrxHL'><style id='SrxHL'><dir id='SrxHL'><q id='SrxHL'></q></dir></style></legend>

      • <bdo id='SrxHL'></bdo><ul id='SrxHL'></ul>
      <i id='SrxHL'><tr id='SrxHL'><dt id='SrxHL'><q id='SrxHL'><span id='SrxHL'><b id='SrxHL'><form id='SrxHL'><ins id='SrxHL'></ins><ul id='SrxHL'></ul><sub id='SrxHL'></sub></form><legend id='SrxHL'></legend><bdo id='SrxHL'><pre id='SrxHL'><center id='SrxHL'></center></pre></bdo></b><th id='SrxHL'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='SrxHL'><tfoot id='SrxHL'></tfoot><dl id='SrxHL'><fieldset id='SrxHL'></fieldset></dl></div>
      <tfoot id='SrxHL'></tfoot>
      1. <small id='SrxHL'></small><noframes id='SrxHL'>

        錯誤:無法在賦值中將“const wchar_t [13]"轉換為

        error: cannot convert #39;const wchar_t [13]#39; to #39;LPCSTR {aka const char*}#39; in assignment(錯誤:無法在賦值中將“const wchar_t [13]轉換為“LPCSTR {aka const char*})
        <legend id='56snq'><style id='56snq'><dir id='56snq'><q id='56snq'></q></dir></style></legend>

            <small id='56snq'></small><noframes id='56snq'>

          1. <tfoot id='56snq'></tfoot>

                <tbody id='56snq'></tbody>

            • <i id='56snq'><tr id='56snq'><dt id='56snq'><q id='56snq'><span id='56snq'><b id='56snq'><form id='56snq'><ins id='56snq'></ins><ul id='56snq'></ul><sub id='56snq'></sub></form><legend id='56snq'></legend><bdo id='56snq'><pre id='56snq'><center id='56snq'></center></pre></bdo></b><th id='56snq'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='56snq'><tfoot id='56snq'></tfoot><dl id='56snq'><fieldset id='56snq'></fieldset></dl></div>
                • <bdo id='56snq'></bdo><ul id='56snq'></ul>
                  本文介紹了錯誤:無法在賦值中將“const wchar_t [13]"轉換為“LPCSTR {aka const char*}"的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  // include the basic windows header file
                  #include <windows.h>
                  #include <windowsx.h>
                  
                  // the WindowProc function prototype LRESULT CALLBACK WindowProc(HWND hWnd,
                                           UINT message,
                                           WPARAM wParam,
                                           LPARAM lParam);
                  
                  // the entry point for any Windows program int WINAPI WinMain(HINSTANCE hInstance,
                                     HINSTANCE hPrevInstance,
                                     LPSTR lpCmdLine,
                                     int nCmdShow) {
                      // the handle for the window, filled by a function
                      HWND hWnd;
                      // this struct holds information for the window class
                      WNDCLASSEX wc;
                  
                      // clear out the window class for use
                      ZeroMemory(&wc, sizeof(WNDCLASSEX));
                  
                      // fill in the struct with the needed information
                      wc.cbSize = sizeof(WNDCLASSEX);
                      wc.style = CS_HREDRAW | CS_VREDRAW;
                      wc.lpfnWndProc = WindowProc;
                      wc.hInstance = hInstance;
                      wc.hCursor = LoadCursor(NULL, IDC_ARROW);
                      wc.hbrBackground = (HBRUSH)COLOR_WINDOW;
                      wc.lpszClassName = L"WindowClass1";
                  
                      // register the window class
                      RegisterClassEx(&wc);
                  
                      // create the window and use the result as the handle
                      hWnd = CreateWindowEx(NULL,
                                            L"WindowClass1",    // name of the window class
                                            L"Our First Windowed Program",   // title of the window
                                            WS_OVERLAPPEDWINDOW,    // window style
                                            300,    // x-position of the window
                                            300,    // y-position of the window
                                            500,    // width of the window
                                            400,    // height of the window
                                            NULL,    // we have no parent window, NULL
                                            NULL,    // we aren't using menus, NULL
                                            hInstance,    // application handle
                                            NULL);    // used with multiple windows, NULL
                  
                      // display the window on the screen
                      ShowWindow(hWnd, nCmdShow);
                  
                      // enter the main loop:
                  
                      // this struct holds Windows event messages
                      MSG msg;
                  
                      // wait for the next message in the queue, store the result in 'msg'
                      while(GetMessage(&msg, NULL, 0, 0))
                      {
                          // translate keystroke messages into the right format
                          TranslateMessage(&msg);
                  
                          // send the message to the WindowProc function
                          DispatchMessage(&msg);
                      }
                  
                      // return this part of the WM_QUIT message to Windows
                      return msg.wParam; }
                  
                  // this is the main message handler for the program LRESULT CALLBACK WindowProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) {
                      // sort through and find what code to run for the message given
                      switch(message)
                      {
                          // this message is read when the window is closed
                          case WM_DESTROY:
                              {
                                  // close the application entirely
                                  PostQuitMessage(0);
                                  return 0;
                              } break;
                      }
                  
                      // Handle any messages the switch statement didn't
                      return DefWindowProc (hWnd, message, wParam, lParam); }
                  

                  ==============我使用 CodeBlock,此代碼來自 Direct X 教程.

                  =============== I use CodeBlock, this code is from a Direct X tutorial.

                  我收到以下錯誤:

                  ||In function 'int WinMain(HINSTANCE, HINSTANCE, LPSTR, int)':|
                  error: cannot convert 'const wchar_t [13]' to 'LPCSTR {aka const char*}' in assignment|
                  |49|warning: converting to non-pointer type 'DWORD {aka long unsigned int}' from NULL [-Wconversion-null]|
                  |49|error: cannot convert 'const wchar_t*' to 'LPCSTR {aka const char*}' for argument '2' to 'HWND__* CreateWindowExA(DWORD, LPCSTR, LPCSTR, DWORD, int, int, int, int, HWND, HMENU, HINSTANCE, LPVOID)'|
                  ||=== Build finished: 2 errors, 1 warnings ===|
                  

                  推薦答案

                  你的項目沒有定義 UNICODE 預處理器符號,所以 Windows API 函數接受字符串指針需要 char* 而不是 wchar_t *.改變

                  Your project doesn't have the UNICODE preprocessor symbol defined, so Windows API functions that take pointers to strings expect char * and not wchar_t *. Change

                  L"WindowClass1"
                  

                  "WindowClass1"
                  

                  對剩余的字符串文字執行相同的操作.或者,將它們更改為 _T("WindowClass1"),這將根據定義的 UNICODE 符號擴展為正確類型的字符串文字.

                  Do the same for the remaining string literals. Alternatively, change them to _T("WindowClass1"), this will expand to the correct type of string literal based on the UNICODE symbol being defined.

                  我的建議是轉到您的項目屬性并將 Character Set 設置更改為 Unicode,然后顯式使用所有 Windows API 函數的寬字符版本.例如,調用 CreateWindowW 而不是 CreateWindow.

                  My recommendation is to go to your project properties and change the Character Set setting to Unicode, and then use the wide char versions of all Windows API functions explicitly. For example, instead of CreateWindow, call CreateWindowW.


                  我建議的項目設置僅適用于 Visual Studio,不確定如何在 Code::Blocks 中執行此操作.


                  The project setting I suggested only applies to Visual Studio, not sure how to do that in Code::Blocks.

                  這篇關于錯誤:無法在賦值中將“const wchar_t [13]"轉換為“LPCSTR {aka const char*}"的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

                  【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

                  相關文檔推薦

                  In what ways do C++ exceptions slow down code when there are no exceptions thown?(當沒有異常時,C++ 異常會以何種方式減慢代碼速度?)
                  Why catch an exception as reference-to-const?(為什么要捕獲異常作為對 const 的引用?)
                  When and how should I use exception handling?(我應該何時以及如何使用異常處理?)
                  Scope of exception object in C++(C++中異常對象的范圍)
                  Catching exceptions from a constructor#39;s initializer list(從構造函數的初始化列表中捕獲異常)
                  Difference between C++03 throw() specifier C++11 noexcept(C++03 throw() 說明符 C++11 noexcept 之間的區別)
                        <bdo id='WYNlq'></bdo><ul id='WYNlq'></ul>
                          • <i id='WYNlq'><tr id='WYNlq'><dt id='WYNlq'><q id='WYNlq'><span id='WYNlq'><b id='WYNlq'><form id='WYNlq'><ins id='WYNlq'></ins><ul id='WYNlq'></ul><sub id='WYNlq'></sub></form><legend id='WYNlq'></legend><bdo id='WYNlq'><pre id='WYNlq'><center id='WYNlq'></center></pre></bdo></b><th id='WYNlq'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='WYNlq'><tfoot id='WYNlq'></tfoot><dl id='WYNlq'><fieldset id='WYNlq'></fieldset></dl></div>
                          • <legend id='WYNlq'><style id='WYNlq'><dir id='WYNlq'><q id='WYNlq'></q></dir></style></legend>

                            <small id='WYNlq'></small><noframes id='WYNlq'>

                              <tbody id='WYNlq'></tbody>
                            <tfoot id='WYNlq'></tfoot>
                            主站蜘蛛池模板: 一区二区免费 | 国产一级片在线播放 | 免费观看av网站 | 国产日产欧产精品精品推荐蛮挑 | 日韩一区二区三区在线播放 | 天堂三级 | 成人3d动漫一区二区三区91 | 91av视频在线播放 | 国产精品久久久久久久久久久久久 | 一区二区三区国产在线观看 | 综合天天久久 | 国产精彩视频一区 | 91xx在线观看 | 精品久久久久久久久久久久久久 | 欧美一级黄 | 超碰操 | 自拍偷拍精品 | 国产精品成人一区二区三区夜夜夜 | 看片国产| 久久久精品网站 | 成人日b视频 | 日韩欧美在线视频 | 国产高清视频在线 | 国产三区视频在线观看 | 久久美女网 | 国产免费av在线 | 国产精品久久久久久婷婷天堂 | 草久免费视频 | 欧美日韩亚 | 视频三区 | 男人天堂午夜 | 成年人黄色小视频 | 久久久精品一区 | 国内精品视频在线 | 欧美福利| 国产成人亚洲精品 | 精品一区av| 国产美女精品视频 | 看片国产 | 日韩视频一区二区 | 精品国产乱码久久久久久蜜柚 |