* Patch from Ocean, Mantis #25798

git-svn-id: trunk@26906 -
This commit is contained in:
marco 2014-02-28 15:19:08 +00:00
parent 14590fb859
commit 17330b94e3

View File

@ -288,6 +288,8 @@ unit comobj;
function ProgIDToClassID(const id : string) : TGUID;
function ClassIDToProgID(const classID: TGUID): string;
function StringToLPOLESTR(const Source: string): POLEStr;
procedure DispatchInvoke(const Dispatch: IDispatch; CallDesc: PCallDesc;
DispIDs: PDispIDList; Params: Pointer; Result: PVariant);
procedure DispatchInvokeError(Status: HRESULT; const ExceptInfo: TExcepInfo);
@ -573,6 +575,17 @@ implementation
end;
function StringToLPOLESTR(const Source: string): POLEStr;
var
Src: WideString;
begin
Src := WideString(Source);
Result := CoTaskMemAlloc((Length(Src)+1) * SizeOf(WideChar));
if Result <> nil then
Move(PWideChar(Src)^, Result^, (Length(Src)+1) * SizeOf(WideChar));
end;
procedure SafeCallErrorHandler(err : HResult;addr : pointer);
{$ifndef wince}
var