久久久久久久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'>

        錯(cuò)誤:無法在賦值中將“const wchar_t [13]"轉(zhuǎn)換為

        error: cannot convert #39;const wchar_t [13]#39; to #39;LPCSTR {aka const char*}#39; in assignment(錯(cuò)誤:無法在賦值中將“const wchar_t [13]轉(zhuǎn)換為“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>
                  本文介紹了錯(cuò)誤:無法在賦值中將“const wchar_t [13]"轉(zhuǎn)換為“LPCSTR {aka const char*}"的處理方法,對(duì)大家解決問題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

                  問題描述

                  // 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.

                  我收到以下錯(cuò)誤:

                  ||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 ===|
                  

                  推薦答案

                  你的項(xiàng)目沒有定義 UNICODE 預(yù)處理器符號(hào),所以 Windows API 函數(shù)接受字符串指針需要 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"
                  

                  對(duì)剩余的字符串文字執(zhí)行相同的操作.或者,將它們更改為 _T("WindowClass1"),這將根據(jù)定義的 UNICODE 符號(hào)擴(kuò)展為正確類型的字符串文字.

                  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.

                  我的建議是轉(zhuǎn)到您的項(xiàng)目屬性并將 Character Set 設(shè)置更改為 Unicode,然后顯式使用所有 Windows API 函數(shù)的寬字符版本.例如,調(diào)用 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.


                  我建議的項(xiàng)目設(shè)置僅適用于 Visual Studio,不確定如何在 Code::Blocks 中執(zhí)行此操作.


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

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

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

                  相關(guān)文檔推薦

                  In what ways do C++ exceptions slow down code when there are no exceptions thown?(當(dāng)沒有異常時(shí),C++ 異常會(huì)以何種方式減慢代碼速度?)
                  Why catch an exception as reference-to-const?(為什么要捕獲異常作為對(duì) const 的引用?)
                  When and how should I use exception handling?(我應(yīng)該何時(shí)以及如何使用異常處理?)
                  Scope of exception object in C++(C++中異常對(duì)象的范圍)
                  Catching exceptions from a constructor#39;s initializer list(從構(gòu)造函數(shù)的初始化列表中捕獲異常)
                  Difference between C++03 throw() specifier C++11 noexcept(C++03 throw() 說明符 C++11 noexcept 之間的區(qū)別)
                        <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在线中文字幕 | 国产小视频网站 | 亚洲一级在线 | 中文字幕精品一区久久久久 | 欧美理论在线观看 | 真人毛片免费看 | 日本一区二区在线播放 | 亚洲精品乱码久久久久久 | 国产日韩精品在线 | 久久综合99 | 久久中文字幕视频 | 午夜av在线播放 | 手机福利视频 | 狠狠操av | 成人免费毛片嘿嘿连载视频 | 美女扒开腿让人桶爽原神 | 午夜久久久久久 | 国产精品永久久久久久久久久 | 激情小说在线视频 | 亚洲色妞 | 国产精品爽爽爽 | 日韩av在线免费 | 亚洲乱淫 | 日韩性视频 | 欧美日韩国产三级 | 日本少妇一区二区 | 天堂成人在线 | 91精品国产综合久久久蜜臀 | av中文天堂 | 综合久久久久 | 视频一二区 | 日韩视频一区二区三区 | 一级片黄色片 | 日日摸天天添天天添破 | 欧美一级淫片免费视频黄 | 亚洲第一色网 | 日韩三级中文字幕 | 久久久久成人网 | 中文字幕一区二区三区四区视频 |