Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: Methods created using stdcall, not safecall.


This question is answered. Helpful answers available: 2. Correct answers available: 1.


Permlink Replies: 1 - Last Post: Oct 4, 2016 1:46 PM Last Post By: William Egge
William Egge

Posts: 98
Registered: 11/29/06
Methods created using stdcall, not safecall.  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 4, 2016 1:28 PM
When I create a method in the ridl editor that has a return result (a function) then Delphi creates a stdcall calling convention in the generated code, If I create a procedure then it uses safecall as expected.

I cannot find anyway to make Delphi use safecall. I edited the environment settings "Safecall function mapping" to All v-table interfaces and it still makes stdcall functions. I tried editing the ridl file but I just hosed it because I did not know what I was doing.

wtf?
William Egge

Posts: 98
Registered: 11/29/06
Re: Methods created using stdcall, not safecall.  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 4, 2016 1:46 PM   in response to: William Egge in response to: William Egge
Problem solved:

You have to create a procedure with an [out, retval] parameter and Return type of HRESULT.

The key was "retval" being added.

Even though it looks like a procedure with an out parameter - Delphi generates the code as a function.
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02