
All is in the title.
I have some .lib files and I know the functions names and arguments.
I'd like to use these .LIB to create new PB commands. Is it possible ?
Thanks.
It does statically link with the lib, so the needed symbols out of the lib will be included in your final compiled exe.@Dri: will it include automatically the .LIB in the .exe I'll create with PureBASIC ?
Code: Select all
Import "MyLib.lib"
SetPoint(x.l, y.l)
GetPoint()
EndImport
ProcedureDLL MySetPoint(x.l, y.l) ; x = x-coordinate, y = y-coordinate
SetPoint(x, y)
EndProcedure
ProcedureDLL MyGetPoint()
ProcedureReturn GetPoint()
EndProcedure
Code: Select all
Import "Basic2D.lib"
dbCls( RGBBackColor.l )
dbInk( RGBForeColor.l, RGBBackColor.l )
dbDot( X.l, Y.l )
dbBox( Left.l, Top.l, Right.l, Bottom.l )
dbLine( X1.l, Y1.l, X2.l, Y2.l )
dbCircle( X.l, Y.l, Radius.l )
EndImport
ProcedureDLL DgdkCLS( RGBColor.l )
dbCls( RGBColor )
EndProcedure
ProcedureDLL DgdkINK( ForeRGBColor.l, BackRGBColor.l )
dbInk( ForeRGBColor, BackRGBColor )
EndProcedure
ProcedureDLL DgdkDOT( X.l, Y.l )
dbDot( X, Y )
EndProcedure
ProcedureDLL DgdkBOX( Left.l, Top.l, Right.l, Bottom.l )
dbBox( Left, Top, Right, Bottom )
EndProcedure
ProcedureDLL DgdkLINE( X1.l, Y1.l, X2.l, Y2.l )
dbLine( X1, Y1, X2, Y2 )
EndProcedure
ProcedureDLL DgdkCIRCLE( X.l, Y.l, Radius.l )
dbCircle( X, Y, Radius )
EndProcedure
Code: Select all
/////////////////////////////////////////////////////////////////////////////////////////////////////////
// BASIC 2D COMMANDS ////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
// INCLUDES /////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
#include <windows.h>
/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
// FUNCTION LISTINGS ////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
void dbCLS ( DWORD RGBBackColor );
void dbInk ( DWORD RGBForeColor, DWORD RGBBackColor );
void dbDot ( int iX, int iY );
void dbBox ( int iLeft, int iTop, int iRight, int iBottom );
void dbLine ( int iXa, int iYa, int iXb, int iYb );
void dbCircle ( int iX, int iY, int iRadius );
void dbElipse ( int iX, int iY, int iXRadius, int iYRadius );
DWORD dbRgb ( int iRed, int iGreen, int iBlue );
int dbRgbR ( DWORD iRGB );
int dbRgbG ( DWORD iRGB );
int dbRgbB ( DWORD iRGB );
DWORD dbPoint ( int iX, int iY );
void dbDot ( int iX, int iY, DWORD dwColor );
void dbBox ( int iLeft, int iTop, int iRight, int iBottom, DWORD dw1, DWORD dw2, DWORD dw3, DWORD dw4 );
void dbLockPixels ( void );
void dbUnLockPixels ( void );
DWORD dbGetPixelsPointer ( void );
DWORD dbGetPixelsPitch ( void );
void ConstructorBasic2D ( HINSTANCE );
void DestructorBasic2D ( void );
void SetErrorHandlerBasic2D ( LPVOID pErrorHandlerPtr );
void PassCoreDataBasic2D ( LPVOID pGlobPtr );
void RefreshD3DBasic2D ( int iMode );
void UpdateBPPBasic2D ( void );
void dbCopyArea ( int iDestX, int iDestY, int iWidth, int iHeight, int iSourceX, int iSourceY );
// lee - 300706 - GDK fixes
DWORD dbRGB ( int iRed, int iGreen, int iBlue );
int dbRGBR ( DWORD iRGB );
int dbRGBG ( DWORD iRGB );
int dbRGBB ( DWORD iRGB );
void dbEllipse ( int iX, int iY, int iXRadius, int iYRadius );
void dbUnlockPixels ( void );
/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////