Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
_FindMemo( ) API Library Routine
Message
De
30/11/2005 20:40:45
 
 
À
30/11/2005 19:44:39
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
01073542
Message ID:
01073554
Vues:
13
This message has been marked as the solution to the initial question of the thread.
Hello,

you've copy & pasted the example from the _FindMemo help right?!

the problem is that they don't specify a calling convention in the function definition.

change:
FAR FindMemoEx(ParamBlk FAR *parm)
to
void _fastcall FindMemoEx(ParamBlk *parm)

what does that mean?
FAR is a relict of old Win 16 bit days, so you can just omit it.
void is "no return value".
_fastcall is the calling convention every FLL function that you want to call from FoxPro has to use.

what is a calling convention by the way?
the calling convention tells the compiler how paramters are passed to a function
e.g.
_fastcall: first paramter is in register ECX, second parameter in register EDX, any other is pushed on the stack
_stdcall: every parameter is pushed on the stack from right to left and the called function cleans up the stack
_cdecl: every paramter is pushed on the stack from left to right and the calling function has to cleanup the stack

the problem was that if you specify no calling convention for a function, the project default is used, which in your case is probably not _fastcall so the function crashes when _FindMemo trys to access the parameter.

Regards
Christian
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform