Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Creating FLL
Message
De
27/05/2016 19:15:09
 
 
À
27/05/2016 05:03:03
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Titre:
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows 10
Divers
Thread ID:
01636848
Message ID:
01636858
Vues:
112
>i want to create a simple fll with c++ (vc++2005)
>
>i downloaded visual studio2008 with vc++2005 only.
>
>i build a test project solution from cpp file as below:
>

I would advise you to enclose your code (below #include "pro_ext.h") inside
extern "C" {
...
}
to avoid problems with different calls conventions between C++ (your code) and C (used in the winapims library).

>*ytest.cpp
>
>// include the library construction header file
>#include "pro_ext.h"
>
>void hello(ParamBlk  *parm) // the function definition
>	{
>	_PutStr("\nHello, World!\n"); //print the message
>	}
>
>// the FoxInfo structure registers the function
>FoxInfo myFoxInfo[] = {
>	{"HELLO",(FPFI) hello, 0, ""},
>};
>
>// the FoxTable structure
>FoxTable _FoxTable = {
>	(FoxTable  *) 0, sizeof(myFoxInfo)/sizeof(FoxInfo), myFoxInfo
>};
>
>
>i add the pro_ext.h (header file) and winapims.lib ( shipped with vfp in samples\api folder)
>
>*note1: there is no fll in the c++ project option but dll.why ?

FLL is just the naming convention for Fox specific DLLs, nothing that Visual Studio knows about.

>can i rename dll to fll or use dll with "set library to.." directly.

Both. But you can also set the target extension to .fll, in your Visual Studio project properties.

>
>i debug and have errors (no dll created)
>f:\yc++\pro_ext.h(53) : fatal error C1083: Cannot open include file: 'Windows.h': No such file or directory
>windows.h is cited in pro_ext.h
>i googled and dont find this file (maybe must download all visual studio....very big).

Windows.h is an essential header file for practically any Windows C/C++ program. You must have it in your system. In my machine it is installed in c:\Program Files (x86)\Windows Kits\8.1\Include\um\Windows.h, and c:\Program Files (x86)\Windows Kits\8.1\Include\um is part of the Include path for VC++.

>*note2: where find this file (but in the same scenario maybe windows.h contains another .h files.
>then must include all these .h file ???

Once the problem of the location of Windows.h is solved, related headers won't be a problem.

>
>*note3: what light visual studio version able to create flls without any problem ?

Community version is ok.
----------------------------------
António Tavares Lopes
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform