Skip to main content
Participant
June 27, 2008
Question

Creating client for FrameMaker 8 using C++

  • June 27, 2008
  • 4 replies
  • 620 views
Hi all,
Now I'm creating client for FrameMaker 8 using FDK 8 .

It populates menu during runtime for accessing another Content management system functionality.all samples in FDK\samples is in C source code.
I need to write C++ source for generate client to implement COM component.

Can any one have sample C++ source code for FDK client.

I'm using FrameMaker 8,FDK 8 and Win 2003 server.

Thanks in advance.
    This topic has been closed for replies.

    4 replies

    Participating Frequently
    July 1, 2008
    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;
    }
    //=================================================
    Participating Frequently
    July 1, 2008
    Hi scott,
    I'm new to FDK and VC++ programming, If you have any sample code can you send me by mail. It would be most helpful and greatly appreciated.

    Thanks
    karthik
    rkarthik27@gmail.com
    Participating Frequently
    June 30, 2008
    Hi Scott,

    This is a very interesting approach. I am in the early stages of getting up to speed with the FDK myself and have been wrestling with how to implement FMC code.

    The FDK documentation contains a chapter that implies the only way to interact with MFC code is to create a DDE server and pass messages between the FDK and the external application.

    Am I correct to assume that your approach gets around the need to implement a DDE server? Any additional details you can pass along would be most helpful and appreciated,

    Martin R. Smith
    martin.smith@golehtek.com
    Participating Frequently
    June 27, 2008
    The FDK is a "C" library. I believe that it may be possible to use these functions in C++ code, but I have not seen examples of this. When I need to make calls to C++ (MFC) code, I develop that code as a separate DLL and make calls to the exported functions using LoadLibrary calls.

    Cheers,

    ...scott