Forum Discussion

AAS's avatar
AAS
Occasional Contributor
6 years ago

SDK Program Object function that returns an interface instance

Hello,

 

I have followed the SDK sample to create my own plugin with Delphi Seattle and it works fine so far.

However, my end goal is to have a method on that object that returns an interface instance, like this:

function GetFirst: INode; safecall;

To that end, I added a second interface in the RIDL file, added the method that returns the new interface, applied the changes and recompiled my plugin.

But as soon as I use code completion to show the methods of my program object, TestComplete crashes.

If I remove that new method but leave the second interface from the RIDL file, it no longer crashes.

When it crashes, it just says "error in oleaut32.dll" without the error message nor any details that would have helped me.

I also tried opening the report file in notepad, but it's not readable directly.

 

What have I missed? How can I have a method that returns an instance of an interface?

 

Regards

3 Replies

  • AAS's avatar
    AAS
    Occasional Contributor

    Ok, for the code completion not to crash anymore, I had to make sure the return type is set to "INode*" and not "INode" inside the ridl editor.

    This does not change the method signature though.

    But that gives me a nice crash when using it, an access violation in oleaut32.dll... I'll investigate further before contacting support

    • AAS's avatar
      AAS
      Occasional Contributor

      I received an answer from support that said that the type must be INode** and not INode* and indeed, it now works just fine.