Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
_FindMemo( ) API Library Routine
Message
From
30/11/2005 21:38:57
 
 
To
30/11/2005 20:40:45
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
01073542
Message ID:
01073559
Views:
15
Christian,

Thanks a lot. It did the trick.

Also in Visual Studio it gave me a warning about

LINK : warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other libs; use /NODEFAULTLIB:library

All options
/OUT:"Debug/CRoutine.dll" /INCREMENTAL /NOLOGO /DLL /DEBUG /PDB:"Debug/CRoutine.pdb" /SUBSYSTEM:WINDOWS /MACHINE:X86 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib

Additional options
winapims.lib

so I added to additional options
/NODEFAULTLIB:MSVCRT

It shouldn't cause any problems, I guess.

Michael

>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
Map
View

Click here to load this message in the networking platform