Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
DLL Hell P2
Message
 
À
12/09/2000 13:54:26
Jim Rieck
Quicken Loans/Rock Financial/Title Sourc
Livonia, Michigan, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Divers
Thread ID:
00415475
Message ID:
00415607
Vues:
12
Hello Jim,
having delved into the world of Dlls, this is the only way I know of exporting functions to the outside world using the Declare statement, this example pops up a ChooseColor() dialog box, to compile this into a dll from Visual Studio using C++, use File/New Project Win32dll Application



#include "windows.h"
#include "commdlg.h"

#define DllExport extern "C" __declspec (dllexport)

DllExport int PKColor(int iInitColor) ;


static COLORREF crCustColors[256] ;
static CHOOSECOLOR cc ;

int WINAPI DllMain(HINSTANCE hinstance,DWORD fdwreason,PVOID pvReserved)
{
return TRUE;
}



DllExport int PKColor(int iInitColor)

{
cc.rgbResult = iInitColor ;
cc.lStructSize = sizeof (CHOOSECOLOR) ;
cc.hwndOwner = NULL ;
cc.hInstance = NULL ;
cc.lpCustColors = crCustColors ;
cc.Flags = CC_FULLOPEN | CC_RGBINIT ;
cc.lCustData = 0 ;
cc.lpfnHook = NULL ;
cc.lpTemplateName = NULL ;
ChooseColor (&cc) ;
return cc.rgbResult ;
}




having compiled it, use this code from the VFP command window



Declare integer PKColor in my.dll integer nColor

nColor = 0
nColor = PKColor(nColor)

by passing nColor on successive calls, you highlight your previously selected colour


Regards,
Peter J. Kane



Pete
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform