如何解决生成DLL时发生C ++错误:const wchar_t *类型的参数与LPWSTR类型的参数不兼容
我是C ++编程的新手。
我需要使用教程中提供的头文件和解决方案文件来创建DLL。我遵循了here中的基本步骤,但是,解决方案文件中出现以下错误:
L111
!CreateProcess(L".\\phreeqc\\phreeqc.exe",
L112
TEXT(".\\phreeqc\\phreeqc.exe .\\phreeqc\\phreeqc_input.txt .\\phreeqc\\phreeqc_input.out .\\phreeqc\\wateq4f_plus.dat")
错误:
L111
C2664'BOOL CreateProcessW(LPCWSTR,LPWSTR,LPSECURITY_ATTRIBUTES,LPSECURITY_ATTRIBUTES,BOOL,DWORD,LPVOID,LPCWSTR,LPSTARTUPINFLOW,LPPROCESS_INFORMATION)':无法将参数2从'const wchar_t [105]'转换为'LPWSTR'
L112
E0167类型为“ const wchar_t *”的参数与参数不兼容 类型为“ LPWSTR”。
我了解以上代码行中的细节对你们中的许多人没有多大意义,但我希望有人至少能够理解C ++错误并在此提供帮助。
解决方法
public class MyItemProcessor implements ItemProcessor<MyItem,MyItem> {
private ExecutionContext executionContext;
public MyItemProcessor() {
this.executionContext = jobExecution.getExecutionContext();
}
@Override
public MyItem process(MyItem item) throws Exception {
// get the line from previous item processors,if exists,otherwise start with 0
int line = executionContext.getInt("myLineKey",0);
item.setLine(line++);
// save the line for other item processors
item.put("myLineKey",line);
return item;
}
}
的Unicode版本(这是一个映射到{
"rules": {
".read": ...
".write": ...
"busStops": {
".indexOn": "busStopName"
}
}
}
的宏)要求library(dplyr)
library(ggplot2)
df %>%
mutate(year = lubridate::year(Date)) %>%
ggplot() + aes(x = year,y=Sales,fill = Holidays) +
geom_col(position = 'dodge')
参数使用可写的字符串,字符串文字为CreateProcess
。因此,您不能直接为该参数传递字符串文字。
相反,您可以这样更改代码:
CreateProcessW
文档here
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。