Path: csiph.com!feeder.erje.net!2.eu.feeder.erje.net!newsfeed.kamp.net!newsfeed.kamp.net!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: Tue, 31 May 2016 16:11:58 +0200 Lines: 47 Message-ID: References: <66abaae4-be73-486e-a8d8-b44d0592b744@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 X-Trace: individual.net LGSO7dy8LhxMtR9d72DBlA3VCN4Lo5ERkrvttzIwNdF6NPO3s= Cancel-Lock: sha1:1kT+buNfklZVz2+V6PwCt0xLoqI= User-Agent: XanaNews/1.18.1.6 Xref: csiph.com comp.lang.clipper.visual-objects:9387 Hi Alex, > I want to integrate a DLL (written in C) from a hardware supplier > into my VO 2.8 code and could not find relevant information in the > group. Or did not know where to search. > > I have a C-header file that provides information about the functions > plus the DLL. > > The DLL is obviously not an automation server, so Automation Server > interface generation from VO would not work. > > If I take a look into e.g. lib zip from Fabrice Foray, there is an > interface defined, e.g. _DLL FUNCTION GetZipDllVersion() AS DWORD > PASCAL:ZIPDLL.GetZipDllVersion > > Is there a way to automatically generate such interface code in VO? > Or would I rather guess and write manually? unfortunately there is no automated way to do this - and guessing is bad, you should know how this need to be implemented. I have done such things several times - if you show maybe a part of the header file and give us the name of the DLL, maybe we can help a little bit. It depends how many functions you have to implement - but of course it is a precise work. And since it is a C DLL, maybe you have also structures and defines to translate.... But the way you have seen in Fabrices zip lip is the correct one. This is a sample: C header file: char * __stdcall zGetFileName(int i); VO interface: _dll function _zGetFileName( nItem as int ) as byte ptr pascal:bszip.dll.zGetFileName Wolfgang --