<legend id='t9Xm0'><style id='t9Xm0'><dir id='t9Xm0'><q id='t9Xm0'></q></dir></style></legend>

    <i id='t9Xm0'><tr id='t9Xm0'><dt id='t9Xm0'><q id='t9Xm0'><span id='t9Xm0'><b id='t9Xm0'><form id='t9Xm0'><ins id='t9Xm0'></ins><ul id='t9Xm0'></ul><sub id='t9Xm0'></sub></form><legend id='t9Xm0'></legend><bdo id='t9Xm0'><pre id='t9Xm0'><center id='t9Xm0'></center></pre></bdo></b><th id='t9Xm0'></th></span></q></dt></tr></i><div id='t9Xm0'><tfoot id='t9Xm0'></tfoot><dl id='t9Xm0'><fieldset id='t9Xm0'></fieldset></dl></div>
  • <tfoot id='t9Xm0'></tfoot>
      • <bdo id='t9Xm0'></bdo><ul id='t9Xm0'></ul>

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

      1. 与类型“LPCWSTR"的参数不兼容;

        时间:2023-10-06
        <i id='Se9xq'><tr id='Se9xq'><dt id='Se9xq'><q id='Se9xq'><span id='Se9xq'><b id='Se9xq'><form id='Se9xq'><ins id='Se9xq'></ins><ul id='Se9xq'></ul><sub id='Se9xq'></sub></form><legend id='Se9xq'></legend><bdo id='Se9xq'><pre id='Se9xq'><center id='Se9xq'></center></pre></bdo></b><th id='Se9xq'></th></span></q></dt></tr></i><div id='Se9xq'><tfoot id='Se9xq'></tfoot><dl id='Se9xq'><fieldset id='Se9xq'></fieldset></dl></div>
      2. <tfoot id='Se9xq'></tfoot>
          <tbody id='Se9xq'></tbody>

            <legend id='Se9xq'><style id='Se9xq'><dir id='Se9xq'><q id='Se9xq'></q></dir></style></legend>

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

                  <bdo id='Se9xq'></bdo><ul id='Se9xq'></ul>
                • 本文介绍了与类型“LPCWSTR"的参数不兼容;的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  #include "stdafx.h"
                  #include <windows.h>
                  #include <stdio.h>
                  #include <iostream>
                  #include <dos.h>
                  using namespace std;
                  
                  class Dir
                  {
                  public:
                      char* cat;
                      Dir()
                      {
                          cout << "(C:/*)
                  ";
                          cat = new char[50];
                          cin >> cat;
                      }
                  
                      void virtual ShowFiles()
                      {
                      }
                  
                  };
                  
                  
                  class Inside : public Dir
                  {
                  public:
                      void virtual ShowFiles()
                      {
                          HANDLE hSearch;
                          WIN32_FIND_DATA pFileData;
                  
                          hSearch = FindFirstFile(cat, &pFileData);
                          if (hSearch != INVALID_HANDLE_VALUE)
                              do
                              {
                                  //  if ((pFileData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY))
                                  cout << pFileData.cFileName << "
                  ";
                              } while (FindNextFile(hSearch, &pFileData));
                              FindClose(hSearch);
                      }
                  };
                  int main()
                  {
                      Dir *obj1[2];
                      obj1[1] = new Inside;
                      obj1[1]->ShowFiles();
                      return 0;
                  }
                  

                  所以我有一个程序,我需要用动态字符 cat 显示目录中的所有文件,但它可以在 Borland C++ 中编译,但在 Visual Studio 15 + Resharper 中它不起作用.严重性代码描述项目文件行char *"类型的错误(活动)参数与LPCWSTR"类型的参数不兼容

                  So I have a program, I need to show with dynamic char cat all file in directory, but it is compilable in Borland C++ but in Visual Studio 15 + Resharper it doesn't work. Severity Code Description Project File Line Error (active) argument of type "char *" is incompatible with parameter of type "LPCWSTR"

                  推荐答案

                  要在 Visual C++ 中编译代码,您需要使用多字节字符 WinAPI 函数而不是宽字符函数.

                  To compile your code in Visual C++ you need to use Multi-Byte char WinAPI functions instead of Wide char ones.

                  设置项目->属性 ->高级(或旧版本的通用)->用于使用多字节字符集

                  另见截图

                  这篇关于与类型“LPCWSTR"的参数不兼容;的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  <tfoot id='yqhxi'></tfoot>
                  • <bdo id='yqhxi'></bdo><ul id='yqhxi'></ul>
                      <tbody id='yqhxi'></tbody>
                    <legend id='yqhxi'><style id='yqhxi'><dir id='yqhxi'><q id='yqhxi'></q></dir></style></legend>
                    1. <small id='yqhxi'></small><noframes id='yqhxi'>

                        • <i id='yqhxi'><tr id='yqhxi'><dt id='yqhxi'><q id='yqhxi'><span id='yqhxi'><b id='yqhxi'><form id='yqhxi'><ins id='yqhxi'></ins><ul id='yqhxi'></ul><sub id='yqhxi'></sub></form><legend id='yqhxi'></legend><bdo id='yqhxi'><pre id='yqhxi'><center id='yqhxi'></center></pre></bdo></b><th id='yqhxi'></th></span></q></dt></tr></i><div id='yqhxi'><tfoot id='yqhxi'></tfoot><dl id='yqhxi'><fieldset id='yqhxi'></fieldset></dl></div>