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
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only