Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Problem with VB DLL
Message
De
08/08/2013 08:26:13
 
 
À
08/08/2013 07:39:11
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP3
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Web
Divers
Thread ID:
01580026
Message ID:
01580037
Vues:
39
Definition of vbHvsCodeTeze not included - this the only .h file ? Technically possible to define function signature in the same .c and not in a .h, but not in my best practices if somebody else is supposed to call it...

seems to be along option2 lines. But http://www.news2news.com/vfp/?article=1#p43 might help you realize it in pure vfp without going to a C-fll.

HTH

thomas

>Here is the Code from the C-header
>maybe you can clear out what the dll expects from here.
>
>
>// hvscode.h
>// Interface fuer hvscode.c
>//
>
>
>#if !defined(HVSCODE_H)
>#define HVSCODE_H
>
>#include <cstdio>
>#include <assert.h>
>#include <malloc.h>
>
>//For VB sKopp 08Mar05
>#include <windows.h>
>
>#if !defined HVSCODEDLL_API
>#define HVSCODEDLL_API __declspec(dllexport) 
>#endif
>
>
>/* ------------------------------------------------------------ */
>/* Lokale Definitionen:						*/
>
>#define	HVS_MDB			"\\hlg_zellko.mdb"
>
>#define	LEN_HAUS_ZUSATZ	8
>
>
>#define	MAX_FIELD_NUM	16
>#define	MAX_FIELD_LEN	64
>#define MAX_TYPEN       30
>#define MAX_TYP_VERWEISE   200
>#define MAXLEVEL         8
>
>#define	LEN_DEPOT_NBR	4
>
>#define	FIELD_SEP	'\t'
>#define	FIELD_SEP_STR	"\t"
>
>#define	FIELD_EMPTY	"_"
>
>#define OK		0
>#define NOK		-1
>
>#define LAND_DEU   "DEU"
>#define LAND_AUT   "AUT"
>
>#define POSTF      "POSTFACH"
>
>#define	STRLEN(xxx)	(sizeof(xxx)-1)
>#define	STRSET(to, len, from)	{ strncpy(to, from, len); to[len] = '\0'; }
>
>
>/* ------------------------------------------------------------ */
>/* Definitions / PreProcessorMacros:				*/
>
>#ifndef	NULL
>#	define	NULL	((void *) 0)
>#endif
>
>#ifdef	__STDC__
>#	define	HvsConst	const
>#else	/*!__STDC__*/
>#	define	HvsConst
>#endif	/*!__STDC__*/
>
>/* ------------------------------------------------------------ */
>/* Datentypen:							*/
>
>/* ------------------------------------------------------------ */
>/* Lokale Datentypen:						*/
>
>typedef	struct	{
>	int	iLen;
>	int	iAlc;
>	char *	pszText;
>	} String;
>
>#define	STRING_INIT	{ 0, 0, NULL }
>
>//typedef	char	HvsStr2[2*sizeof(HvsStr)];
>
>typedef	struct	{
>	char *  pszLkz;
>	char *	pszPlz;
>	char *	pszOrt;
>	char *	pszStr;
>	char *	pszZlw;
>	char *	pszHaus1;
>	char *	pszZus1;
>	char *	pszHausN;
>	char *	pszZusN;
>	} HvsKey;
>
>
>typedef	unsigned char	HvsChr;
>
>typedef	enum	{
>		HvsFalse = 0,
>		HvsTrue = 1
>	} HvsBool;
>
>typedef	enum	{
>	HvsRcOK	= 0,		/* Alles OK			*/
>	HvsRcNoFind,		/* TEZE nicht gefunden , PLZ o.k.	*/
>	HvsRcNullPlz,		/* Codierung KO wegen PLZ ,nächsthöhere PLZ verwendet 	*/
>	HvsRcLkzInval,		/* Länderkennzeichen ungültig	*/
>	HvsRcVersionError,  /* Versionsfehler (PLZ ungleich STR oder leer)  */
>	HvsRcNYI,		    /* Funktion gibt's nicht	*/
>	HvsRcPostfach,		/* keine Teze wg. Postfach  */
>	HvsRcOutOfSpace,	/* m(re)alloc hat ein Problem!	*/
>	HvsRcOpenFailed,	/* Datei nicht gefunden	*/
>	HvsRcSqlError,      /* allgemeiner SQL Fehler  */
>	HvsRcMax		    /* Kommt nicht vor. Anzahl RCs!	*/
>	} HvsRc;
>
>typedef	struct	{
>	long	lRc[HvsRcMax];
>	long	lLoadStr;
>	long	lLoadPlz;
>	double	dLoadsPerSecond;
>	long	lCalls;
>	long	lHits;
>	long	lDupKey;
>	long	lStdOrt;
>	long	lStdStr;
>	} HvsStats;
>
>typedef	struct	{
>	HvsConst HvsChr	*	pszLkz;
>	HvsConst HvsChr	*	pszPlz;
>	HvsConst HvsChr	*	pszOrt;
>	HvsConst HvsChr	*	pszStr;
>	} HvsAdr;
>
>//sKopp 08Mar2005
>typedef	struct	{
>	 LPVOID		vbLkz;
>	 LPVOID		vbPlz;
>	 LPVOID		vbOrt;
>	 LPVOID		vbStr;
>	} vbHvsAdr;
>
>//sKopp 19Apr2005
>typedef	struct	{
>	 char*      vgLkz[1+1];
>	 char*		vbPlz[1+1];
>	 char*		vbOrt[1+1];
>	 char*		vbStr[1+1];
>	} glHvsAdr;
>
>typedef	char		HvsLkz[3+1];   // Länderkennzeichen
>typedef	char		HvsDepot[3+1];
>typedef	char		HvsStr[50+1];
>typedef	char		HvsPlz[10+1];
>typedef	char		HvsOrt[50+1]; //HvsOrt[24+1];
>typedef	char		HvsZlw[1+1];	/* Zaehlweise	*/
>typedef	char		HvsMKnz[1+1];	/* MehrfachKnz	*/
>typedef	char		HvsHaus[4+1];
>typedef	char		HvsZus[1+1];
>typedef	char		HvsTeze[4+1];
>typedef	char		HvsVon[6+1];
>typedef	char		HvsBis[6+1];
>typedef	char		HvsDepotName[20+1];
>typedef char        HvsVersion[4+1];
>typedef	char		HvsRout[20+1];
>typedef	char		HvsLevel[5+1];
>typedef	char		HvsStelle[80+1];
>typedef	char		HvsKurzt[10+1];
>typedef char        HvsStrtype[10+1]; 
>
>typedef char        HvsErrMsg[255];
>typedef char        HvsSqlstate[10];
>
>
>typedef	struct	{
>	HvsZlw	szZlw;
>	HvsHaus	szHaus1;
>	HvsZus	szZus1;
>	HvsHaus	szHausN;
>	HvsZus	szZusN;
>	} HvsAbs;
>
>typedef	struct	{
>	HvsDepot	szDepot;
>	HvsDepotName szDepotName;
>	HvsTeze		szTeze;
>	HvsStr		szStr;
>	HvsHaus		szHaus;
>	HvsZus		szZus;
>	HvsPlz		szPlz;
>	HvsOrt		szOrt;
>	HvsVon		szVon;
>	HvsBis		szBis;
>	HvsZlw		szTyp;
>	HvsVersion  szVersion;
>	HvsLkz		szLkz;
>	HvsErrMsg   szErrMsg;
>	} HvsCode;
>
>typedef	struct	{
>	HvsRout     szRoutine;
>	HvsLevel    szLevel;
>	HvsStelle   szStelle;
>	HvsKurzt    szKurztyp; 
>	} HvsCodeErw;
>
>typedef struct  {
>	HvsLkz		szLkz;
>	HvsStrtype  szStrassentyp;
>	HvsKurzt    szKurztyp;
>	int			szStrTypNr;
>}  HvsTypverweis;
>
>typedef struct  {
>	int			nr;
>	HvsStrtype  szStrassentyp;
>}  HvsTypen;
>
>
>
>typedef struct {
>	int iDepot;
>	HvsPlz  plz;
>	HvsDepotName depotName;
>	HvsVersion version;
>} HvsDepotItems;
>
>typedef struct  {
>	HvsSqlstate  szSqlState;
>	HvsErrMsg    szErrMsg;
>	int          nativeError;
>	int          wErrMsg;
>}  HvsErrorInfo;
>
>/* ------------------------------------------------------------ */
>/* Datentypen:							*/
>
>#ifdef	__cplusplus
>extern	"C" {
>#endif	/*__cplusplus*/
>
>
>HVSCODEDLL_API HvsRc __stdcall	HvsCodeOpen(HvsConst char * pszDir);
>
>HVSCODEDLL_API HvsRc __stdcall	HvsCodeTeze(HvsCode * pCode, HvsConst HvsAdr * pAdr);
>
>HVSCODEDLL_API HvsRc __stdcall	HvsCodeTezeAnalyze(HvsCode * pCode, HvsCodeErw * pCodeErw , HvsConst HvsAdr * pAdr, int * zugriffe, HvsErrorInfo *err);
>
>HVSCODEDLL_API void	__stdcall HvsCodeClose();
>
>HvsRc	HvsCodeTezeIntern (HvsCode * pCode, HvsConst HvsAdr * pAdr, HvsErrorInfo *err);
>
>
>#ifdef	__cplusplus
>};
>#endif	/*__cplusplus*/
>
>#endif 
>
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform