![](/img/trans.png)
[英]Delphi: TRichEdit Text in non-default non-Unicode system language as String (ANSI)
[英]How to get non-default interfaces in Delphi from a COM control?
我已經將一個 OCX 控件導入到 Delphi,它顯示了 TLB 和 OCX 類。 它工作正常,但我只能訪問默認界面。
如何訪問其他接口?
您可以在實例引用上使用as
運算符,例如:
(SomeOcxObject as IPersistStreamInit).InitNew;
或者走很長的路,自己調用QueryInterface
:
var
x:IPersistStreamInit;
begin
if SomeOcxObject.QueryInterface(IPersistStreamInit,x)<>S_OK then
RaiseLastOSError;
x.InitNew;
(我只是在這里使用IPersistStreamInit
作為示例,您沒有指定要使用的接口。)
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.