Uniface User Forum

 View Only
  Thread closed by the administrator, not accepting new replies.
  • 1.  Uniface 9: Interface to ELSTER

    ROCKETEER
    Posted 11-19-2018 11:40
    No replies, thread closed.

    Interface to ELSTER

    Author: i2stiller@gmx.de (istiller)

    Hi freaks We have to implement a interface to the german tax office software "ELSTER". Does anyone allready did this? If yes, with or without a wrapper around the ELSTER API? I'm trying to avoid another software between our software and ELSTER. ELSTER does provide  "simple" C/C++ API but some of the parameters a C-structs and handles My question is, how to implement this by pure UnifAce? Every marketing guy from UnifAce allways tell us, how easy it is to use UnifAce, so there must be a simple solution in UnifAce :-) Ingo



  • 2.  RE: Uniface 9: Interface to ELSTER

    ROCKETEER
    Posted 11-19-2018 11:40
    No replies, thread closed.

    Hi Ingo, A C struct is defined as an entity in Uniface and passed as an occurence. If an array of structs is required then it is passed as an entity. Be careful of C's requirement for a null terminated strings. More information is availble in the documentation: Integrating with Other Technologies > C, C++, and Other 3GLs > Call-Out to 3GL > Activate Using Occurrence and Entity Parameters  A handle in C does not have a clearly defined datatype as it just a method of identifying a single item (https://en.wikipedia.org/wiki/Handle_(computing) ) for these you will have to match the base type. Regards, Mike


    Author: Mike Taylor (michael.taylor@uniface.com)


  • 3.  RE: Uniface 9: Interface to ELSTER

    ROCKETEER
    Posted 11-19-2018 11:40
    No replies, thread closed.

    ThanX Mike


    Author: istiller (i2stiller@gmx.de)


  • 4.  RE: Uniface 9: Interface to ELSTER

    ROCKETEER
    Posted 11-19-2018 11:40
    No replies, thread closed.


  • 5.  RE: Uniface 9: Interface to ELSTER

    ROCKETEER
    Posted 11-19-2018 11:40
    No replies, thread closed.
    Arjen van Vliet said
    Mike Taylor said Integrating with Other Technologies > C, C++, and Other 3GLs > Call-Out to 3GL > Activate Using Occurrence and Entity Parameters    
    Integrating with Other Technologies > C, C++, and Other 3GLs > Call-Out to 3GL > Activate Using Occurrence and Entity Parameters  

    next problem :-) I did solve the char* problem in a struct Thanks to Arthur at the U.B.G, this is the solution in short :      activate $INST_SHLWAPI$."STRDUPA"(v_STRHND,v_STR) But now I'm facing another interesting challenge: How to transfer the NULL-Pointer? Say, there is a declaration like    int fct(struct_t* apointer) In Uniface you have to create a signature with one parameter which as an occurence e.g "STRUCT_T" Now you call this by activate v_INST."OPER"("STRUCT_T") Super, I can transfer a struct to a DLL But wait, as the manual of the functions state, this parameter is optional and should be NULL sometimes   activate v_INST."OPER"(0)  *grumble*  I got error -54 Define the parameter in signature as numeric/long solves the problem with NULL-pointer But now it's not possible to pass the struct anymore But I need both versions My workaround for the moment will be a few signatures, one version with occurence and one with numeric (for each such parameter) Anyone a better idea? @UnifAce:   Such simple things is allways missing in UnifAce.   We are developing for the real world not for mobiles in the desert (As heard on U.B.G in Kassel/Germany)   Gruß Ingo


    Author: istiller (i2stiller@gmx.de)


  • 6.  RE: Uniface 9: Interface to ELSTER

    ROCKETEER
    Posted 11-19-2018 11:40
    No replies, thread closed.

    Hi Ingo, What's wrong with the simple solution to create two operations? I've faced a similar problem in the past where a function requires different input or returns different results (string, numeric, structure, ...). I simply created an operation for each scenario and it works just fine. Don't really understand what is not simple about this. It would of course be nice if it would be possible to specify different data types for a parameter in a signature or even define a signature dynamically at runtime. But alas, signatures definitions are quite static and in some scenarios you need "redundant" definitions to achieve the desired result. You're facing a similar problem with COM Call-Out signature where a method returns different objects depending on the context. In this case you also need to create a separate operation for each object that could be returned. Could we come up with more elegant solutions? Sure. Is it really necessary? No, IMO the current functionality is sufficient enough for almost all use cases. Instead of grumbling I've simply created a little tool that allows me to duplicate an operation of a signature. Simple. Don't overthink it, just do it. Daniel PS Have a nice weekend...


    Author: diseli (daniel.iseli@uniface.com)


  • 7.  RE: Uniface 9: Interface to ELSTER

    ROCKETEER
    Posted 11-19-2018 11:40
    No replies, thread closed.
    diseli said Hi Ingo, It would of course be nice if it would be possible to specify different data types for a parameter in a signature or even define a signature dynamically at runtime. But Instead of grumbling I've simply created a little tool that allows me to duplicate an operation of a signature. Simple. PS Have a nice weekend...  

    Hi Daniel The first thing - after I analysing the problem und thinking about a workaround - was to build such program to duplicate signatures ;-) About the different types of parameters:     There parameter(s) in question are pointers to a structure. And this pointers could be the NULL-pointer, not a different type.     That the same "problem" with strings in UnifAce: An empty string is a different thing then a NULL-string     On strings, UnifAce replace an empty string by NULL, but on entity-parameter this is not true :-(  About copiing the operations:    As there is not only one struct parameter but some of them, if have to create 2^n operation, where n is the number of struct-parameters    Not onyl, that one have to create this operations, you also have to find reasonable names for them So, on 9.7.07 we got this kind of parameter (""->NULL-pointer) Or ? :-) Ingo PS: also a nice (tail-)weekend


    Author: istiller (i2stiller@gmx.de)