Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Vc++
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Titre:
Re: Vc++
Divers
Thread ID:
00166468
Message ID:
00167552
Vues:
28
How are you compiling this? C++ compilers perform name mangling
which is incompatible with WinAPI calling conventions.

I guess you can override the objects, but then question becomes
why would you do this? It's an object and you can't really
create it on your own. You'd have to load it in DLLMain and then
leave it running the entire lifetime of the DLL.


+++ Rick ---

>Rick,
>
>You can use member functions as the entry points. From VFP they look like plain functions, but they are member functions of the class derived from CWinApp. For example:
>
>In the .h
>
>class CSpyinApp : public CWinApp
>{
>public:
> int FilterData( int nStringLen, int nCharsPerWord, LPSTR cStringData );
> CSpyinApp();
>
>// Overrides
> // ClassWizard generated virtual function overrides
> //{{AFX_VIRTUAL(CSpyinApp)
> //}}AFX_VIRTUAL
>
> //{{AFX_MSG(CSpyinApp)
> // NOTE - the ClassWizard will add and remove member functions here.
> // DO NOT EDIT what you see in these blocks of generated code !
> //}}AFX_MSG
> DECLARE_MESSAGE_MAP()
>};
>
>In the .cpp:
>
>int CSpyinApp::FilterData(int nStringLen, int nCharsPerWord, LPSTR cStringData)
>{
>// code here
>}
>
>In the .def:
>
>; spyin.def : Declares the module parameters for the DLL.
>
>LIBRARY "spyin"
>DESCRIPTION 'spyin Windows Dynamic Link Library'
>
>EXPORTS
> ; Explicit exports can go here
> FilterData @1
>
>
>>You can't DECLARE to objects and object methods. If you want to use classes etc.
>>in VC++ you'll have to create wrapper functions that call the object and
>>then DECLARE those in VFP.
+++ Rick ---

West Wind Technologies
Maui, Hawaii

west-wind.com/
West Wind Message Board
Rick's Web Log
Markdown Monster
---
Making waves on the Web

Where do you want to surf today?
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform