Path: csiph.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: "Wolfgang Riedmann" Newsgroups: comp.lang.clipper.visual-objects Subject: Re: How to integrate C DLL into VO and generate interface code Date: Thu, 16 Jun 2016 06:03:24 +0200 Lines: 100 Message-ID: References: <66abaae4-be73-486e-a8d8-b44d0592b744@googlegroups.com> <7de24866-5bfe-439f-befb-099a84afe0d0@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: individual.net VDSDnpoNR4Tn2HhbvSo2NAX57zKKEj+qPYMJhjI/rfmBFXQeU= Cancel-Lock: sha1:0OqRQoMU1G0pFB1vBDcfyJWr+PY= User-Agent: XanaNews/1.18.1.6 Xref: csiph.com comp.lang.clipper.visual-objects:9435 Hi Alex, > "@" seems required for "IS" to indicate the call-by-reference, for > "AS" no "@" is required or possible. Reference seems implicit. yes, you are right. Please see this working code from Fab Paintlib: LOCAL pRect IS _winRECT LOCAL Width, Height AS LONG // GetClientRect( hWnd, @pRect ) Width := pRect.Right - pRect.Left + 1 Height := pRect.Bottom - pRect.Top + 1 > BTW: Exchanging AS (+allocating) / IS (no allocating) does not help. this is very strange. Do you have any piece of documentation? Some could it be that the C DLL allocates the memory for the structure and needs to free it afterwards? Do that you need to pass in a pointer to the structure? Wolfgang > > @Karl-Heinz: > > > First of all you should tell us exactly what GetItem() does. > > > - which members must be filled before calling GetItem() ? > > - which members are filled by the C-DLL ? > > GetItem(nItem, ptrStruc) actually fetches all information written on > the RFID tag identified by a number "nItem" and writes it into the > structure "ptrStruc" that is called by reference from VO. E.g. > ID-Number of the tag, author, ISBN number, etc. If there is e.g. only > one tag on the reader, then the item can be addressed with nItem=0 > (meaning actually the first and only one). > > There is no need to initialize anything, i.e. everything is filled by > the C-DLL. However, I also tried if initializing would help, but it > ain't. > > > Guessing that the C-DLL writes at least a string to "uID" , you > > might try it > with a modfied structure > > I did try your version, but same issue. :-( > > > Wondering, though the C-Headerfile e.g. publishes the Functionname > > "GetItem", you´re not able to import the function using that name > > ... > > I was wondering too, actually. But I received "procedure entry point > missing" errors without. > > @Gerhard: > > > > Then you maybe have to use 'ALIGN 1' to declare that data structure. > > I tried different alignments, but same issue. But thanks for pointing > out. > > > Do you have a C-Sample to use that DLL? > > Only a code snippet from the API doc: > > TRPINFO myInfo; > memset(&myInfo, 0, sizeof(TRPINFO)); > int result = GetItem (0, &myInfo); > if (result < 0) > { > // Fehler; > … > return; > } > cout << myInfo.itemId << endl; > > Pretty similar to my implementation. > > I guess I have to practice with other DLLs e.g. libzip to see if I am > basically able to populate structures without generating crashes ;-) > and then have another iteration with the provider guys. > > I'll keep you posted. May take a while... > > Best, > Alex --