qbawler311
asked on
Need help initializing a variable of type LPWSTR?
I am currently getting the following error when I try to initialize a member of the AT_INFO structure:
C:\rocklobsterj\Ptest1\Net schedule.c pp(25) : error C2440: '=' : cannot convert from 'char [42]' to 'unsigned short *'
The NetScheduleJobAdd() function takes three parameters, one of which uses an AT_INFO structure. One of its members is of type LPWSTR.
typedef struct _AT_INFO {
DWORD JobTime;
DWORD DaysOfMonth;
UCHAR DaysOfWeek;
UCHAR Flags;
LPWSTR Command;
} AT_INFO, *PAT_INFO, *LPAT_INFO;
Here's the way I'm attemting to initialize the 'Command' member:
AT_INFO myATINFO;
myATINFO.JobTime = 36000000 ;
myATINFO.DaysOfMonth = 0;
myATINFO.DaysOfWeek = 1;
myATINFO.Flags = JOB_RUN_PERIODICALLY;
myATINFO.Command = "c:\\rocklobsterj\\version 1\\classes \\RLCITEST ";
C:\rocklobsterj\Ptest1\Net
The NetScheduleJobAdd() function takes three parameters, one of which uses an AT_INFO structure. One of its members is of type LPWSTR.
typedef struct _AT_INFO {
DWORD JobTime;
DWORD DaysOfMonth;
UCHAR DaysOfWeek;
UCHAR Flags;
LPWSTR Command;
} AT_INFO, *PAT_INFO, *LPAT_INFO;
Here's the way I'm attemting to initialize the 'Command' member:
AT_INFO myATINFO;
myATINFO.JobTime = 36000000 ;
myATINFO.DaysOfMonth = 0;
myATINFO.DaysOfWeek = 1;
myATINFO.Flags = JOB_RUN_PERIODICALLY;
myATINFO.Command = "c:\\rocklobsterj\\version
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks jkr, sorry so late.
char acCommand [ MAX_PATH] = "c:\\rocklobsterj\\version
wchar_t awcCommand;
wsprintfW ( awcCommand, "%S", acCommand);
myATINFO.Command = awcCommand;