Re: [fpc-pascal] How to call C++ function with Vector

2017-09-26 Thread leledumbo via fpc-pascal
> Would it be possible to do this via a Lua shim? How is it even related with that? -- Sent from: http://free-pascal-general.1045716.n5.nabble.com/ ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org

Re: [fpc-pascal] How to call C++ function with Vector

2017-09-26 Thread Dennis Poon
Marco van de Voort wrote: I myself generally solve this with a wrapper DLL, by crafting a DLL in C++ that exports a C (not C++) interface, and then use that. The same method as QT is used from Lazarus (via wrapper dll/.so qtpas) ___ Thanks. I

Re: [fpc-pascal] How to call C++ function with Vector

2017-09-26 Thread Marco van de Voort
In our previous episode, Dennis said: > I have a windows 32-bit dll written in C++ (probably C++ Builder). > It has 1 function which I need to call: > > int SPAPI_GetProduct(vector& apiProdList) > > I am stuck at the keyword vector. It is not a keyword it is a generic type. So that is not easy,

Re: [fpc-pascal] How to call C++ function with Vector

2017-09-26 Thread leledumbo via fpc-pascal
> I am stuck at the keyword vector. > > How is it translated into free pascal? It's hard, you must create additional wrapper that exposes simpler type (pointer or array of pchar) OR make wrapper for the vector methods and simply declare it as an opaque pointer. std::vector is template/generic

[fpc-pascal] How to call C++ function with Vector

2017-09-26 Thread Dennis
I have a windows 32-bit dll written in C++ (probably C++ Builder). It has 1 function which I need to call: int SPAPI_GetProduct(vector& apiProdList) I am stuck at the keyword vector. How is it translated into free pascal? Is the following correct? type TSPApiProduct_Array = array of