草庐IT

ERR_INVALID_ARGUMENT

全部标签

c++ - 错误 : argument of type char* is incompatible with parameter of type LPCWSTR

#include#includeusingnamespacestd;intmain(){char*file="d:/tester";WIN32_FIND_DATAFindFileData;HANDLEhFind;hFind=FindFirstFile(file,&FindFileData);//lineoferrorsaysargumentoftypechar*isincompatiblewithparameteroftypeLPCWSTR}我无法理解错误。错误是什么以及如何解决错误?我正在制作一个控制台应用程序,需要检查目录中是否有文件。 最佳答案

c++ - boost .python : Argument types did not match C++ signature

我在python中调用C++函数时遇到一个奇怪的问题。我公开了一个我想从中调用函数的类:class_>("MyClass",init())//....def("someFunc",&MyClass::someFunc);我得到一个std::shared_ptr来自另一个类的成员变量,该类通过.def_readonly(...)公开当我尝试调用该函数时,出现以下错误:File"pytest.py",line27,intest_funccu.someFunc("string")Boost.Python.ArgumentError:PythonargumenttypesinMyClass.s

parser.add_argument:错误:未识别的参数:true

我在Python2.7中有一个程序,该程序具有一系列代码:parser.add_argument('--skip_train',default=False,help='skiptraining',action='store_true')该代码告诉程序默认情况下进行培训。但是现在我想在没有培训的情况下实施它,因为培训已经完成。因此,我输入了提示:pythonmyprogame.py--skip_trainTrue但这给出了一个错误消息:error:unrecognizedarguments:True应该在提示命令中输入什么以实现该程序?看答案当您使用时action='store_true',您不

c++ - 如何抛出 std::invalid_argument 错误?

我在C++的Fraction类中有一个重载运算符,它旨在从标准输入中获取整数形式的输入,即1/2或32/4并根据这些值初始化一个Fraction对象。它有效,但我无法捕获错误。//getsinputfromstandardinputintheformof(hopefully)int/intstd::istream&operator>>(std::istream&inputStream,Fraction&frac){intinputNumerator,inputDenominator;charslash;if((std::cin>>inputNumerator>>slash>>input

c++ - MPI_ERR_BUFFER : invalid buffer pointer

这个错误最常见的原因是什么MPI_ERR_BUFFER:invalidbufferpointerMPI_Bsend()和MPI_Rcev()调用的结果是什么?当并行进程数较少( 最佳答案 扩展我之前的评论:MPI中的缓冲可以在各种情况下发生。MPI库可以在内部缓冲消息以隐藏网络延迟(通常只对不超过实现相关大小的小消息进行缓冲)或者用户可以通过使用任何缓冲发送操作来强制执行缓冲MPI_Bsend()和MPI_Ibsend()。用户缓冲与内部缓冲不同:首先,由MPI_Bsend()或MPI_Ibsend()发送的消息总是被缓冲的,而内部

c++ - CreateFile 返回错误 INVALID_HANDLE_VALUE(对于 COM 端口),GetLastError 返回 "can' t 找到指定的文件”

我正在打开一个端口与设备通信并控制设备,但是CreateFile()函数返回INVALID_HANDLE_VALUE。GetLastError()返回2,这意味着它找不到指定的文件。我的代码如下所示:wsprintf(szPort,"COM%d",nPort);m_hIDComDev=CreateFile(szPort,GENERIC_READ|GENERIC_WRITE,0,NULL,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL|FILE_FLAG_OVERLAPPED,NULL);if(m_hIDComDev==INVALID_HANDLE_VALUE){

c++ - 警告 C4244 : 'argument' : conversion from 'double' to 'const int' , 可能丢失数据

我正在定义“*”运算符以使用“NumericArray”类模板。代码如下:templateNumericArrayNumericArray::operator*(constT&factor)const{NumericArraynewArray(Size());for(inti=0;i当我尝试将类型为“int”的“NumericArray”(NumericArray)与“*”运算符一起使用时,当“factor”参数为double时:intArray1=intArray1*2.5;我收到以下编译器警告:warningC4244:'argument':conversionfrom'doubl

解决npm ERR! path E:\XXX\node_modules\node-sass的问题

在Node.js项目中,我们经常使用npm来安装和管理各种依赖包。然而,有时候我们可能会遇到一些关于npm的错误,其中最常见的就是"npmERR!pathE:\XXX\node_modules\node-sass"。这个错误通常是由于node-sass的路径问题导致的。下面我将详细介绍如何解决这个问题。1.确定问题的原因首先,我们需要确定问题的原因。在这个例子中,错误信息显示的是node-sass的路径是E:\XXX\node_modules\node-sass。这意味着node-sass可能没有被正确地安装在我们的项目目录中。2.检查node-sass是否已经安装我们可以使用npmlist命

c++ - 错误 : invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator<<'

我想获取z_Data的第48个字符的第6位{charc=pPkt->z_Data[47];//thisz_Dataisacharbufferstd::cout>3)&1>4)&1>5)&1 最佳答案 优先级高于&,所以你需要:std::cout>3)&1)>4)&1)>5)&1) 关于c++-错误:invalidoperandsoftypes'int'and''tobinary'operator https://stackoverflow.com/questions/246

C++ 谷歌模拟 SaveArg : how to save a pointer argument

我在保存模拟接收到的指针参数时遇到困难。#defineSIZE_OF_DATAtypedefstruct{uint32_tsomeValue1;uint16_tsomeValue2;//othervalueshere}LargeStruct;classSomeClass{public://assumesendDataisagenericfunctionwheredataisactuallypointertoaLargeStructvoidsendData(constuint8_t*data,constuint16_tsize);}classMockClass:publicSomeCla