>I am trying to write a simple function in Visual C++ 6.0 (DLL) which add
>2 variables that I send from Visual FoxPro 6.0, ADD them together and return the value back to VFP. How I can do this ? (Please give me some sample code)
Disclaimer: I'm not booted on a partition that has VC++ 6.0 installed, so this is off the top of my head.
Create a DLL, and when prompted by the wizard, select "DLL that exports some symbols". This will give you a template of how to return a value (one of the functions returns 42. Get it?) Create your own function as follows:
int MyFunction(int FirstNumber, int SecondNumber)
{
return FirstNumber + SecondNumber;
}
Create a .DEF file in the project. In that file, you need to specify that you're exporting MyFunction using the EXPORTS statement. See the MSDN on how to do this (
this link gives an example). Compile and you're done. I think that there's also an example floating around in the files section or the FAQ.
Mike Stewart