Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

FOXPRO PLB 1

Status
Not open for further replies.

bianliaw

IS-IT--Management
Jan 5, 2004
13
ID
I need help how to build file *.PLB.
can anyone help me the steps, pleasseee.

TIA
 
You'll need to write code in C and compile it with the library kit of Foxpro.

What version of Foxpro are you using?
Do you have the library kit?

Rob.
 
I have Foxpro Version 2.6a,

and I have library kit too.

can you help me explain how to build PLB file (may be a litle example). please...

TIA.

Bian
 
Creation of a library with WATCOM C/C++ für DOS:
The LCK disk provides "DOSWAT.MAK" for the creation of a .plb file.
Working with the Watcom C version 10.0a I use the following batchfile to create a library.
As example to create curdrive.plb:

REM ----------- curdrive.BAT --------------
IF EXIST curdrive.lnk DEL curdrive.lnk
IF EXIST curdrive.obj DEL curdrive.obj
IF EXIST curdrive.plb DEL curdrive.plb
IF EXIST curdrive.sym DEL curdrive.sym
IF EXIST curdrive.wat DEL curdrive.wat
IF EXIST curdrive.err DEL curdrive.err
WMAKE /f doswat.mak PLBNAME=curdrive MODEL=l
REM ----------- curdrive.BAT --------------



/* Sourcecode: curdrive.c */
/* Function --> CURDRIVE.C */

/* First Block ( SETUPAREA ) : Declaration- and include part: */
#include <dos.h> /* DOS-Declarationpart (Registerdefinitions)*/
#include <pro_ext.h> /* FoxPro Headerfile (Declaration part) */

/* ..in the second block you put the function itself : */

void FAR _cdrive(ParamBlk FAR *parm) /* parm = FAR-Pointer at ParamBlk */
{
union _REGS r ; /* r is a REGISTER-TYPE */
unsigned int current_drive ; /* current_drive is type INT */
r.h.ah = 25 ; /* fill AH-Register with 25d = 19h, h=BYTE-Reg*/
_int86(0x21,&r,&r) ; /* Call Interrupt */
current_drive = r.h.al ; /* Get the LOW-Value
aus AX-Register */
_RetInt(current_drive + 65,1); /* Return the value + 65 [ 65 = A] */
}

/* ..in the third block you'll find the arrayInfo-structure, that contains the calling names and internal names for every function and their parameters and parameters types. */

/* FoxInfo --> functionname FOX, functionname C, Parameter, "types,,," */

FoxInfo myFoxInfo[ ] =
{
{"CDRIVE", (FPFI) _cdrive, 0, ""},
};

/* FPFI is a 32-Bit-pointer to a function */
/* ..in the forth block you'll find a structuredefinition, with pointers to that info-structure of this library. */

FoxTable _FoxTable =
{
(FoxTable FAR *)0, sizeof(myFoxInfo) / sizeof(FoxInfo), myFoxInfo
};
/* End of file */
/* usage in foxpro: ? asc(curdrive()) */



Rob.
 
outstanding example Rob... star!

boyd.gif

 
Rob.

there is error when compile :

wmake /f doswat.mak PLBNAME=curdrive MODEL=1

the error is :

This is an OS/2 32-bit executable

I am using win XP and I've tried at win 98 too.

TIA


 
Use the wmake sentence without the MODEL=1 part.

Rob.
 
Bianliaw,

If you want send me a zipfile with the source(s) to be compiled and let me have a look and try at it.

Send it to: nocure AT hccnet DOT nl

Rob.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top