BLACKFIRE69
Новичок
...
Последнее редактирование:
@Timickit feels like all these attributes [MarshalAs(UnmanagedType.BStr)] are redundant - next to FreeArc, in the documentation, there is an example of use for C# - didn't you think to do it by analogy?
>> Library - Delphi <<
type
TCallback = function(OverallPct, CurrentPct, DiskTotalMB,
DiskExtractedMB: Integer; DiskName, CurrentFile, TimeStr1, TimeStr2,
TimeStr3, Speed: PWideChar): longint; stdcall;
var
DiskName: WideString;
function ISArcExInit(..., Mycallback: TCallback): boolean; stdcall;
TCallback(Mycallback)(..., StringToOleStr(DiskName), ...)
>> Native App - C # <<
--> Structures:
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
public delegate long Callback(int OverollPct, int CurrentPct,
int DiskTotalMB, int DiskExtractedMB,
[MarshalAs(UnmanagedType. LPWStr)] string DiskName,
[MarshalAs(UnmanagedType. LPWStr)] string CurrentFile,
[MarshalAs(UnmanagedType. LPWStr)] string TimeStr1,
[MarshalAs(UnmanagedType. LPWStr)] string TimeStr2,
[MarshalAs(UnmanagedType. LPWStr)] string TimeStr3,
[MarshalAs(UnmanagedType. LPWStr)] string Speed);
>> Library - Delphi <<
type
TCallback = function(OverallPct, CurrentPct, DiskTotalMB,
DiskExtractedMB: Integer; DiskName, CurrentFile, TimeStr1, TimeStr2,
TimeStr3, Speed: UnicodeString): longint; stdcall;
var
DiskName: UnicodeString;
>> Native App - C # <<
--> Structures:
[UnmanagedFunctionPointer(CallingConvention.StdCall, CharSet =CharSet. Unicode)]
public delegate long Callback(int OverollPct, int CurrentPct,
int DiskTotalMB, int DiskExtractedMB,
[MarshalAs(UnmanagedType. BStr)] string DiskName,
[MarshalAs(UnmanagedType. BStr)] string CurrentFile,
[MarshalAs(UnmanagedType. BStr)] string TimeStr1,
[MarshalAs(UnmanagedType. BStr)] string TimeStr2,
[MarshalAs(UnmanagedType. BStr)] string TimeStr3,
[MarshalAs(UnmanagedType. BStr)] string Speed);
thanks...I'll be able to take a full look after January 6.