testinterface2.pro

来自「Visual Prolog 7.1的一些学习资料,希望对您有用」· PRO 代码 · 共 41 行

PRO
41
字号
/*****************************************************************************

    Copyright (c) Prolog Developement Center

 Written by: Visual Prolog
******************************************************************************/

implement testInterface2 inherits comInterface
facts
    nativeInterface : iTestInterface2 .%release of interface is handled inside ccomInterface class

clauses
    newComponent(ComponentClassID) :-
        CompIF = comCreation::createInstance(ComponentClassID, iTestInterface2::iid),
        nativeInterface := uncheckedConvert(iTestInterface2, CompIF),
        comInterface::new(nativeInterface).

clauses
    new(ImportedInterface):-
        nativeInterface := uncheckedConvert(iTestInterface2, ImportedInterface:queryInterface(iTestInterface2::iid)),
        comInterface::new(nativeInterface).

clauses
    method1(Input, Output):-
        comExceptionCheck::check(
            comExceptionCheck::classInfo,
            "method1",
            nativeInterface:method1(Input, ComOutput),
            []),
        Output = string::createCopy(ComOutput),
        comMemory::taskMemFree(uncheckedConvert(pointer,ComOutput)).

clauses
    method_Interface2(Output) :-
        comExceptionCheck::check(
            comExceptionCheck::classInfo,
            "method_Interface2",
            nativeInterface:method_Interface2(Output),
            []).
end implement testInterface2

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?