Information générale
Catégorie:
Fonctions Windows API
Don't you prefer to have everything in just one place? (eg the export declaration in the same place as the function declaration)
Vlad
>I don't use the macros at all. Member functions of the class that are callable in the DLL are just simply:
>
>defined in the H file:
>
>class CSpyinApp : public CWinApp
>{
>public:
> int FilterData( int nStringLen, int nCharsPerWord, LPSTR cStringData );
>...}
>
>coded in the .cpp file:
>
>int CSpyinApp::FilterData(int nStringLen, int nCharsPerWord, LPSTR cStringData)
>{...}
>
>Then in the .def file I just list the entry points:
>
>EXPORTS
> ; Explicit exports can go here
> FilterData @1
>
>>>>I have never needed do modify the .def file manually. I just declare the functions extern "C" and __declspec(dllexport). So, I can use the dll from C/C++ (statically or dynamically) and VFP. What am I missing here?
>>>
>>>Well, I've never gotten it to work without it. Also the DLL Wizards
>>>create the DEF file by default, so...
>>
>>I know a .def file gets created by the wizards, but I never modify it directly. As I said, it's enough to declare the functions as I said. Unless there's something I'm missing and I never got hit by IT! :)
>>
>>>I think it may have to do with the WINAPI macro I use. WINAPI allows
>>>for importing and exporting depending on how you use the lib file,
>>>so maybe it needs the explicit pointers to the export functions.
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement