我有文件,其中写的用户名,IP和密码必须是const char *,当我在const char中放置变量时,我收到此错误消息.
这是我的代码:
#include <cstdlib> #include <iostream> #include <stdio.h> #include <windows.h> using namespace std; typedef int (__cdecl *MYPROC)(LPWSTR); int main() { HINSTANCE hinstDLL; MYPROC ProcAdd; hinstDLL = LoadLibrary("LmServerAPI.dll"); if(hinstDLL != NULL){ ProcAdd = (MYPROC) GetProcAddress(hinstDLL,"LmServer_Login"); if(ProcAdd != NULL){ const char* IP = "xxx.177.xxx.23"; const char* name = "username"; const char* pass = "password"; int port = 888; ProcAdd(IP,port,name,pass); system ("pause"); } } }
我收到了这个错误:
cannot convert
const char*' to
WCHAR*’ in argument passing
我必须使用哪种变量用于这些参数以及如何使用?