Newsgroups : Borland : borland.public.delphi.rtl.win32 : 2005 Jun : Error 1113 - No mapping for the Unicode character exists in the target multi-byt

www.cryer.info
Managed Newsgroup Archive

Error 1113 - No mapping for the Unicode character exists in the target multi-byt

Subject:Error 1113 - No mapping for the Unicode character exists in the target multi-byt
Posted by:"Matt" (none'none.com)
Date:Wed, 29 Jun 2005 10:19:21

Hi All,

I've searched and searched but I have been unable to find out exactly what
this error means and how I can resolve it in the code below. Can anyone shed
any light on the subject?

  Error 1113 -  "No mapping for the Unicode character exists in the target
multi-byte code page"

Many thanks in advance.


type
   NET_API_STATUS = DWORD;
   LPBYTE = pointer;
   PATInfo = ^TATInfo;
   TATInfo = record
    JobTime       : DWORD;
    DaysOfMonth   : DWORD;
    DaysOfWeek    : UCHAR;
    Flags         : UCHAR;
    Command       : LPWSTR
   end;
const
  JOB_RUNS_TODAY             =  $04;
  JOB_ADD_CURRENT_DATE       =  $08;


function lNetScheduleJobAdd(aMachine:string;
                            aTime: DWORD;
                            DaysOfMonth: DWORD;
                            DaysOfWeek: Byte;
                            Flags: Byte;
                            mycommand: widestring ):DWORD;
var
  hLib : THandle;
  Flag : DWord;
  Ergebnis : DWord;
  P : function (Servername: LPCWSTR; Buffer: PATinfo; JobId: LPDWORD ):
DWord; stdcall;
  myatinfo: TATinfo;
  pmyatinfo: PATinfo;
  time: SYSTEMTIME;
begin
  P := nil;
  hLib := LoadLibrary('NETAPI32.DLL');
  P := GetProcAddress(hLib,'NetScheduleJobAdd');

  myatinfo.JobTime := aTime;
  myatinfo.DaysOfMonth := DaysOfMonth;
  myatinfo.DaysOfWeek := DaysOfWeek;
  myatinfo.Flags := Flags;
  myatinfo.Command := PWideChar(mycommand);

  pmyatinfo:=@myatinfo;
  Result := P(PWideChar(aMachine), pmyatinfo, @flag);

  FreeLibrary(hLib);
end;


Function call:

Windows.GetLocalTime(time);
res := lNetScheduleJobAdd(computer, ((Time.wHour*3600 +
(Time.wMinute+1)*60)*1000), 0, 0,
                                           JOB_ADD_CURRENT_DATE,
'c:\windows\system32\cmd.exe /C dir C:\ > C:\test.txt');

Replies:

www.cryer.info
Managed Newsgroup Archive