dll call in uniface 9

Author: dylan.huart@gmail.com (Dylan)

Hello everyone, I'm trying to familiarize myself with the IDE UNIFACE 9 and its programming language, to make changes to an application. I developed a DLL in C it can return a path, so a char *, the called function takes no argument, I wanted to call this function from UNIFACE. I could see that we could use it to Activate call: Activate "NameOfDLL". NameOfFonction ($$ variable) I told my dll in signatures, but I is not nothing in return. my question is: What is $$variable returns the return of my function?   Thanks !

2 Comments

  1. Hi Istiller! Thank you for your invaluable help! my problem is solved your explanations were very understandable thank you very much Wink


    Author: Dylan (dylan.huart@gmail.com)
  2. Hi Dylan There a two ways to get a "return value" into UnifAce 1. If the type of the returned value is a integer (includes pointers/handles), on can use $status       But if you get a handle or pointer, UnifAc itself don't know how to use this one.       So you have to call another DLL which take a pointer as parameter to do somethin usefull with pointers/handles       Okay, there are some expetions to this rule 2. If the type is other the an integer (that is true also for "pointer to ..."), one have to use the first parameter   So how to say UnifAce in which way it will return the return value? This is very easy: Enter the signature editor and open the signatue in question. Set focus onto the right operation. The goto detail of this operation (">>" button on the right side behind the detail box "'Details of 'xyz'") There are three possible states for the return value )None, $status, first parameter) Click that one you need. In UnifAce code you now have to activate your DLL in a proper way: 1. By $status; ACTIVATE "MY_DLL"."MY_OPER"() v_RETURN_VALUE=$status 2. BY first parameter ACTIVATE "MY_DLL"."MY_OPER"(v_RETURN_VALUE) That's all BTW: Don't forget to compile the signature and create a new URR Ingo


    Author: istiller (i2stiller@gmx.de)