cancel
Showing results for 
Search instead for 
Did you mean: 

SDK Program Object function that returns an interface instance

AAS
Occasional Contributor

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 3
AlexKaras
Community Hero

Re: SDK Program Object function that returns an interface instance

Hi,

 

I believe that you'd better contact Support directly via the https://support.smartbear.com/message/?prod=TestComplete form as, most probably, they will ask you for your source code.

Regards,
  /Alex [Community Hero]
____
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
================================
AAS
Occasional Contributor

Re: SDK Program Object function that returns an interface instance

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
Occasional Contributor

Re: SDK Program Object function that returns an interface instance

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

New Here?
Join us and watch the welcome video:
Announcements
Top Kudoed Authors