开发者

VC++ LPTSTR Error

开发者 https://www.devze.com 2023-01-23 07:42 出处:网络
I am doing a project on firewall. I am not familiar very much with VC++. Though I am much sound in java and c#. But for my project sake I needed to create a dll. For what I exported 2 pre-written .h a

I am doing a project on firewall. I am not familiar very much with VC++. Though I am much sound in java and c#. But for my project sake I needed to create a dll. For what I exported 2 pre-written .h and .cpp files to my c++ project. But it is giving error on compile. Saying can not convert to LPTSTR etc. But it is compiling perfectly in the other project from where I fetch those files. Am I missing something? Please help.

Thanks.

ERRORS:

Code:

driverPath = (LPTSTR)malloc(strlen(path) + 1);

Error:

'strlen' : cannot convert parameter 1 from '开发者_StackOverflowLPCTSTR' to 'const char *'

Code:

strcpy(driverPath, path);

Error:

strcpy' : cannot convert parameter 1 from 'LPTSTR' to 'char *'


Your project configuration Character Set is probably set to Unicode. In the project settings, change your project configuration Character Set to Not Set or use const TCHAR * instead of const char *

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号