PRODUCT : Borland C++ NUMBER : 1288 VERSION : 3.1 OS : WIN DATE : October 25, 1993 PAGE : 1/2 TITLE : Creating a C++ DLL callable from Paradox for Windows. Creating a C++ DLL callable from Paradox for Windows ==================================================== This document describes a simple a DLL that is callable from within Paradox for Windows Object PAL. It creates a single function MYFUNC that takes as parameters: a window handle, and a pointer to a string. It then calls MessageBox to display a standard Windows message box which contains the string. Included below are two files, PWDLL.CPP and PWDLL.DEF. To create the DLL, issue the following command from a DOS prompt: BCC -WDE -w PWDLL.CPP Now create a Paradox for Windows form, and insert a button into it. In the pushbutton method for the button, add the following code: uses pwdll MYFUNC( hWnd CWORD, msgstring CPTR ) CWORD enduses method pushbutton( var eventInfo event ) MYFUNC( windowHandle(), "Hello from Paradox for Windows!!" ) endmethod Now run the form, push the button and viola! The magic of DLL's is now at your fingertips. //********************************************************************* // // FILE: PWDLL.CPP // #define STRICT #include // turn off name mangling for the exported functions #ifdef __cplusplus extern "C" { #endif PRODUCT : Borland C++ NUMBER : 1288 VERSION : 3.1 OS : WIN DATE : October 25, 1993 PAGE : 2/2 TITLE : Creating a C++ DLL callable from Paradox for Windows. UINT CALLBACK _export MYFUNC( HWND, LPSTR ); #ifdef __cplusplus } #endif int FAR PASCAL LibMain( HINSTANCE, WORD, WORD, LPSTR ) { return 1; } UINT CALLBACK _export MYFUNC( HWND hWnd, LPSTR msgstring ) { MessageBox( hWnd, msgstring , "Info from Paradox for Windows", MB_OK ); return 1; } // // FILE : PWDLL.DEF // LIBRARY PWDLL DESCRIPTION 'DLL that is callable from Paradox for Windows' EXETYPE WINDOWS CODE PRELOAD MOVEABLE DISCARDABLE DATA PRELOAD MOVEABLE SINGLE HEAPSIZE 8192 DISCLAIMER: You have the right to use this technical information subject to the terms of the No-Nonsense License Statement that you received with the Borland product to which this information pertains.