Peter,
Which book ? :) Different versions define the process different.
Would he check these :
#include <pro_ext.h>
/*Other include and code*/
void FAR MyFunction(ParamBlk FAR *parm)
{
/*code*/
}
/*1 would be param count and "?" types of params*/
FoxInfo myFoxInfo[] =
{
{"VFPFunc", (FPFI) MyFunction, 1, "?"},
};
extern "C" {
FoxTable _FoxTable =
{
(FoxTable *) 0, sizeof(myFoxInfo)/sizeof(FoxInfo), myFoxInfo
};
}
C++\Code generation\Calling convention :Fastcall
C++\Code generation\Use run-time library : MTDLL
Link\General\Library modules : winapims.lib (added)
Link\General\Ignore All default libraries 'UNCHECKED'
Cetin
>David,
>
>It sounded like a great idea, and I'm sure it is, but we must be doing something wrong, because even when declaring the functions, the DLL does not work.
>
>Registering goes ok, but when calling the function(s), the DLL won't load.
>
>Like I wrote, I'm no C hawk, so I hav no idea if the guy's doing it right - but he assured me he went by the book on this.
>
>Are the any secrets we might have missed out on? Header files, libraries & stuff?
>
>TIA
>
>>Peter,
>>
>>If the C code is not trying to access VFP routines then it's much simpler to just compile the C code to a DLL and use a DECLARE command in VFP to access it. There are two different VC++ sample projects and the VFP code to access the DLLs over on my website. They are under the Samples section SpyIn and DeQuote.
>>
>>>A colleague of mine has written a C routine that's supposed to write messages to the eventlog.
>>>
>>>As far as I can determine, he went by the book as described in VFP Help.
>>>
>>>When I SET LIBRARY TO MyVeryOwn.FLL I get a Library...is invalid message, and that's it.