Managing DLLs with UNIFACE

Author: i2stiller@gmx.de (istiller)

Hi Shawn First: Do the exported functions in the DLL follow the C-declaration conventions? If not, you have to program a little wrapper to do so Next step: In IDE there is a menu item called "signature"  (upper menu->editor->signature) Create a new signature (plus-sign or F6) and enter a new (e.g. like the DLL) Goto implementations and select "C" Then: Create a new operation (=function)  [Use the upper of two plus-sign at the right side ] Enter a operationname on the left side, then back to the ">>" sign on the right side Input the literal name of the function (case sensitiv!)   "Return value" :  Does your function return an integer like value, then choose "$status" else "first parameter" Now:  Enter the paramteres of the operation/function (lower plus-sign) and edit the literal name and types (">>") That's all to define a C-function in UnifAce. Don't forget to generate the URR and insert a line into the ASN-file [user_3gl] X:\path\your_dll.DLL To call such a function: There are two ways to do so: Implicit or explicit instantiation of the DLL 1. very simple activate "signaturename"."operationname"(<para1>,<para2>,....) 2. A little bit of overhead newinstance "signaturename",v_INST ; where v_INST is a variabe defined in a UnifAce procedure v_STATUS=$status ; If defined "Return value = $status ;... maybe some code activate "signaturename"."operationname"(<para1>,<para2>,....) v_STATUS=$status ; If defined "Return value = $status ;... maybe some code delete v_INST Hope, I could help you a little bit :-) Ingo  

1 Comment

  1. If you would like to read more on 3GL integration in a top-down way, you would probably best start in the online documentation at this point: http://unifaceinfo.com/docs/0907/Uniface_Library_HTML/ulibrary/Integration_with_3GL_Intro_5C78B89F827A6C6E9B32B838AD34C762.html


    Author: Arjen van Vliet (arjen.van.vliet@uniface.com)