I can't provide all of the necessary code, but you should be able to make some progress with the following info ..
1) Create the MFC DLL and provide an "exported" function that will be called from your FDK code. I believe that there are a number of ways to do this, but I do it by adding the function name to the EXPORTS section of the project's DEF file.
2) Add the RunDllFunction (below) to your FDK project. You'll need to tweak this function to accommodate the parameters you want to pass from the FDK code to the external DLL. You also need to change the function callback prototype (line that starts with "typedef int") and the actual function call("lpfnDllFunc1") so the parameter number and types all match.
Give it a whirl and see how it goes. :)
...scott
//=================================================
IntT
RunDllFunction(StringT dllFile, StringT dllFunction, StringT paramOne, StringT paramTwo, IntT paramThree)
{
typedef int (CALLBACK* LPFNDLLFUNC1)(LPTSTR, LPTSTR, int);
int ret = 0;
if (Pt_FileExists(dllFile)) {
LPFNDLLFUNC1 lpfnDllFunc1;
HINSTANCE hGetProcIDDLL = LoadLibrary(dllFile);
if (hGetProcIDDLL) {
lpfnDllFunc1 = (LPFNDLLFUNC1)GetProcAddress(hGetProcIDDLL, dllFunction);
if (lpfnDllFunc1) {
ret = lpfnDllFunc1(paramOne, paramTwo, paramThree);
}
FreeLibrary(hGetProcIDDLL);
}
else {
F_Printf(NULL, "ERROR: Unable to load DLL! [%s]\n", dllFile);
}
}
else {
F_Printf(NULL, "ERROR: Unable to locate DLL! [%s]\n", dllFile);
}
return ret;
}
//=================================================