Skip navigation
nigel long
Currently Being Moderated

compiling Frame 10 / 11 API clients in VS 2010, etc

Jul 30, 2012 2:57 AM

Tags: #framemaker10 #api #compile #framemaker11

Hi -

 

We have some old Frame APIs developed under 7.1 that we want to run in new Frame10 environment... I eventually managed to compile them using VS 2010 and the FM10 FDK libraries, but get the generic "Cannot initialize API client, etc" message when I try and open a document...

 

Now, I suspect, but don't know for sure, this might be because the FM10 FDK was built using VS2008...

 

By coincidence, Adobe then sent us a copy of Frame11... I installed this and used the compiled API (figuring that FM11 was VS2010-friendly...), but - unsurprisingly - got the same message.

 

My next step was going to be to recompile the API using the FM11 FDK libraries instead of FM10... but couldn't find them on the installation disk.

 

Anyone know where I can find FM11 FDK, please....?

 

Plan B is to re-compile the API in VS2008 (instead of 2010) using the FM10 FDK and see if that clears the problem.... that will be a pain, I'm sure, and also feels like a backward-step....

 

Anyone with any experience of recompiling FM7 APIs onto FM10... I'd be very interested in hearing your experiences. We've had to go from using VS6 / FM7.1 to VS2010 / FM10 - quite a jump!

 

Thanks, Nigel

 
Replies
  • Currently Being Moderated
    Jul 30, 2012 4:15 AM   in reply to nigel long

    Hi Nigel,

    Does your plugin run if you run FM in debug mode out of your Visual Studio project.

    I think this will work, and if you run your release build, it won't run.

    So I think VC++ 2010 Redistibutable Package isn't installed on your workstations.

     

    You'll find it here: http://www.microsoft.com/de-de/download/details.aspx?id=5555

    If you're running VS 2010 SP1 take this one: http://www.microsoft.com/de-de/download/details.aspx?id=8328

     

    This should solve your problem.

     

    bye

    Markus

     
    |
    Mark as:
  • Currently Being Moderated
    Jul 30, 2012 4:45 AM   in reply to nigel long

    Hi Nigel,

    I've compiled FDK clients with VS2010 successfully for nearly 2 years now.

    On clients my main problem was missing vcredists, when an API client failed loading.

    So first check if you're running VS2010 with Service Pack 1. If so make sure redists are SP1 too.

     

    If all works well, try to run your plugin in debug mode. Does it work?

    If so, check other dependencies to other DLLs you included to your project.

    if not, set a break point to F_ApiInitialize. Does VS stop at this break point.

    If so, go step by step and check where a problem in your code could be.

    If the message appears without stopping at the breakpoint, check the Output window in VS. Perhaps there will be more information.

     

    So in my opinion, there's no need to switch to VS2008.

     

    BTW: you'll find FDK11 here: http://www.adobe.com/devnet/framemaker.html

     

    Bye

    Markus

     
    |
    Mark as:
  • Currently Being Moderated
    Jul 30, 2012 6:21 AM   in reply to Wiedenmaier

    Hi Nigel,

     

    Your post rings familiar with me and harkens back to the many struggles I had with this. It seems that there are a number of project properties which must be exactly right, otherwise that generic initialization failure occurs.

     

    My journey included a lot of trial and error, but the first steps to success started by comparing the properties of a sample project with mine. A collegue pointed me to the "PreserveEntity" plugin source that installs with FM10, which is found on my machine at:

     

    C:\Program Files\Adobe\AdobeFrameMaker10\Structure\xml\PreserveEntity\src

     

    This is a VS2008 project, but you should be able to make a comparison with VS2010 settings. I put the two projects side by side and made adjustments as necessary.

     

    After that, there were two more things I did:

     

    - Made sure that I'm always compiling with the FDK version that matches the target FM version. Any deviation from this tended to cause initialization failures, especially if compiling with a newer version of the FDK than the target version of FM.

     

    - Followed the advice I received here (once again, thanks to Marcus):

     

    http://tech.groups.yahoo.com/group/frame_dev/message/1856

     

    I hope you can access that link... the advice from Marcus was critical for getting it to work for me. Please read the entire thread and see what I did.

     

    I hope this helps. I believe that the solution is in your project properties and should not require any laborious workarounds, but it might be tricky to get it figured out.

     

    Russ

     
    |
    Mark as:
  • Currently Being Moderated
    Jul 30, 2012 7:01 AM   in reply to Russ Ward

    Hi Russ,

    thanks for keeping that two year old post in mind.

    Perhaps that could solve Nigel's problem.

    I don't run into such problems, because I allways create new projects if I switch my VS-Version :-)

    Markus

     
    |
    Mark as:
  • Currently Being Moderated
    Jul 30, 2012 7:38 AM   in reply to nigel long

    Hi Nigel,

     

    developping software without debugging; sounds cool

     

    here's the complete thread from frame_dev forum:

     

    (SOLVED) Re: Can't get client to initialize on FM10, Win7, using FDK10

     

     

    Most of you probably don't need this clarification, but I meant to say
    preprocessor "definitions", not "directives." Just making sure, though.

     

    --- In frame_dev@yahoogroups.com, "russwardwsc" <russ@...> wrote:
    >
    > Markus, you are a genius. This appears to be solved... hopefully that
    appearance isn't misleading. Two Win7/FM10 users report successful
    initialization, whereas before there was none.
    >
    > It turns out that those preprocessor directives do matter. I first removed the
    runtime check setting (/RTC), but still no joy. Then I made the preprocessor
    directive changes you indicated and suddenly everything started working. I
    personally do not have any idea what those directives are used for, but given
    the sudden turnaround, I'm sure they were part of the problem.
    >
    > I can't thank you enough for this help. I would likely never have figured that
    out on my own.
    >
    > Russ
    >
    > --- In frame_dev@yahoogroups.com, "Markus Wiedenmaier" <markus.wiedenmaier@>
    wrote:
    > >
    > > Hi Russ,
    > >
    > > I think I found the dog in your project settings.
    > > I compiled your sample project with VS2010 and have the same effect, you
    > > described.
    > >
    > > (Sorry if got a German version of VS and I don�t know if translation fits
    > > the englisch Version, but I think you will find it)
    > >
    > > C++ > Code generation > Complete runtime check.
    > > This setting is on "Both (/RTC1 is /RTCsu) (/RTC1)".
    > > Put it to Standard.
    > > It's only allowed in Debug-Builds.
    > >
    > > I change preprocessor definition from _DEBUG to NDEBUG and removed _USRDLL.
    > > But I think these two changes doesn't matter.
    > >
    > > I hope this helps in your VS2008 project, too.
    > >
    > > Bye
    > > Markus
    > >
    > > -----Urspr�ngliche Nachricht-----
    > > Von: frame_dev@yahoogroups.com [mailto:frame_dev@yahoogroups.com] Im Auftrag
    > > von russwardwsc
    > > Gesendet: Dienstag, 7. Juni 2011 14:03
    > > An: frame_dev@yahoogroups.com
    > > Betreff: [frame_dev] Re: Can't get client to initialize on FM10, Win7, using
    > > FDK10
    > >
    > > Hi Harsh,
    > >
    > > Thank you very much for your offer of continued assistance. And thanks to
    > > all who have helped... this is a critical issue for me on many levels.
    > >
    > > With hopes of finding further expert advice, I have created a simple "Hello
    > > World" project and wrapped the entire thing up (with compiled binaries) and
    > > posted it here:
    > >
    > > http://www.weststreetconsulting.com/downloads/AXCM_test_project.zip
    > >
    > > It has a single API call that pops up a prompt upon initialization; however,
    > > initialization should fail on FM10/Win7. If you relink to the FM10 include
    > > and lib files on your computer, you should be able to rebuild it as well.
    > >
    > > Note again that this is a VS2008 solution (VC++9.0).
    > >
    > > Many thanks again,
    > > Russ
    > >
    > >
    > > --- In frame_dev@yahoogroups.com, Harsh Gupta <harshg@> wrote:
    > > >
    > > > Hi Russ,
    > > >
    > > > Yes I wanted you to compile with /MD switch. But since this is not
    > > working, can you please send me your binary compiled with FDK10? Or, once
    > > you get the "cannot initialize...", please look at the application log at
    > > the following location on win7 machine:
    > > >
    > > >
    > > > 1) Right Click on My Computer and click on Mange.
    > > >
    > > > 2) Just look at the error at the following location: Computer
    > > Management -> System Tools -> Event Viewer -> Windows Logs -> Application.
    > > >
    > > > 3) Is there any error message over there?
    > > >
    > > > In this scenario, dependency walker as suggested by Curtis can be very
    > > helpful.
    > > >
    > > > Thanks!
    > > > Harsh
    > > >
    > > > From: frame_dev@yahoogroups.com [mailto:frame_dev@yahoogroups.com] On
    > > Behalf Of russwardwsc
    > > > Sent: Saturday, June 04, 2011 1:00 AM
    > > > To: frame_dev@yahoogroups.com
    > > > Subject: [frame_dev] Re: Can't get client to initialize on FM10, Win7,
    > > using FDK10
    > > >
    > > >
    > > >
    > > > Harsh,
    > > >
    > > > Thanks for the input. Unfortunately, this doesn't help. By "release
    > > binary", I assume you mean to compile with the /MD switch and generate no
    > > debug info. The same problem occurs... that "cannot initialize API client"
    > > message. Is there another setting I need to configure for the release
    > > binary?
    > > >
    > > > By the way, this is complicated by the fact that I don't have Windows 7
    > > currently. I'm using the help of several others who do. Three different
    > > individuals have tried and reported the same problem. The client does start
    > > up fine on my machine, Windows XP.
    > > >
    > > > Thanks,
    > > > Russ
    > > >
    > > > --- In frame_dev@yahoogroups.com<mailto:frame_dev%40yahoogroups.com>,
    > > Harsh Gupta <harshg@> wrote:
    > > > >
    > > > > Russ,
    > > > >
    > > > > By looking at your VC setting, I guess you are using debug binary of
    > > your client.
    > > > >
    > > > > Are you able to initialize this client on the machine where it was
    > > complied? If yes, then may be on the other machine, debug libraries for
    > > MSVCRT aren't present, and that's the reason for generic "cannot initialize
    > > API client".
    > > > >
    > > > > Can you please try using a release binary of your client on the other
    > > machine? Let me know in case this works, or if you need further help.
    > > > >
    > > > > Thanks!
    > > > > Harsh Gupta
    > > > > FrameMaker Engineering
    > > > >
    > > > > From: frame_dev@yahoogroups.com<mailto:frame_dev%40yahoogroups.com>
    > > [mailto:frame_dev@yahoogroups.com<mailto:frame_dev%40yahoogroups.com>] On
    > > Behalf Of russwardwsc
    > > > > Sent: Friday, June 03, 2011 6:49 PM
    > > > > To: frame_dev@yahoogroups.com<mailto:frame_dev%40yahoogroups.com>
    > > > > Subject: [frame_dev] Can't get client to initialize on FM10, Win7, using
    > > FDK10
    > > > >
    > > > >
    > > > >
    > > > > Hi,
    > > > >
    > > > > I'm in bad shape here and would graciously accept any help. I cannot get
    > > a client to initialize on FM10 on Win7 compiled with FDK10 (I get that
    > > generic "cannot initialize API client" message). I'm using VC++9 (VS 2008).
    > > If I change the FDK version or Windows version (ie, Win XP) the client
    > > initializes.
    > > > >
    > > > > I have exhausted my limited personal resources and don't have any idea
    > > what to do. If it weren't for the F_ApiChooseFile bug (see yesterday's post)
    > > I could just use FDK9. I'm thinking I might just need to bite the bullet and
    > > build my own folder browser to work around this.
    > > > >
    > > > > Here is a link to my project settings. If anyone has the time and/or
    > > knowledge, could you review them for anything that might be causing this
    > > problem?
    > > > >
    > > > > http://www.weststreetconsulting.com/downloads/VC++9_project_settings.z ip
    > > > >
    > > > > Many thanks,
    > > > > Russ
    > > > >
    > > >
    > >
    > >
    > >
    > >
    > > ------------------------------------
    > >
    > > Yahoo! Groups Links
    > >
    >

     
    |
    Mark as:
  • Currently Being Moderated
    Jul 30, 2012 7:59 AM   in reply to nigel long

    Nigel,

     

    If you are doing any kind of FDK work, that Yahoo group is a must. There are a few hacks like myself that troll around here, but most of the real genuises (like Marcus) hang out at the other list. I can't speak to any security issues regarding Yahoo, but I can assure you that you are much more likely to get FDK answers there.

     

    Russ

     
    |
    Mark as:
  • Currently Being Moderated
    Jul 31, 2012 12:50 PM   in reply to nigel long

    Hi Nigel,

    I think you haven't declared the directory to the FDK libraries.

    Add this path in your project settings i.e. to

     

    Configuration Settings > VC++ Directories > Library directories

     

    (Sorry if got a German version of VS and I don't know if translation fits

    the englisch Version, but I think you will loacate it)

     

    BTW:

    If your are developping a structured client with struct lib, perhaps you will run into a further linker error __set_sbh_threshold with FDK 10 and VS2010 (I don't know if it's still there in FDK 11).

    If so put the following line somewhere into one of your global includes.

    int __cdecl _set_sbh_threshold(size_t _NewValue) {return 1;}

     

    Bye

    Markus

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 1, 2012 5:07 AM   in reply to nigel long

    Hi Nigel,

    use /MDd switch in debug settings and /MD for release settings.

    That changed in FDK 10.

    Perhaps you have to exclude libcmt in "ignore standard libraries" setting in category linker. Not sure if always necessary.

     

    BTW:

    add include (FDK/include) directories to Configuration Settings > VC++ Directories > Include directories

    and library (FDK/lib) directories to  Configuration Settings > VC++ Directories > Library directories

     

    Hope this helps

    Markus

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 1, 2012 5:35 AM   in reply to Wiedenmaier

    Hi Nigel,

     

    In addition to what Markus said, when I compile with /MD for a release build, I specify the following libraries to ignore:

     

    libcmt.lib,libcmtd.lib,libcd.lib,msvcrtd.lib

     

    Also, I use /MD for a debug build as well and have had no problems, other than a pile of compiler warnings similar to:

     

    api.lib(apidebug.obj) : warning LNK4099: PDB 'fdk.pdb' was not found with '..\..\lib10\api.lib' or at 'c:\Program Files\Adobe\AdobeFrameMaker10\WestStreet\fdk.pdb'; linking object as if no debug info

     

    ...which somebody from Adobe said was OK. My release configuration compiles clean.

     

    Here is a link to a PDF file that shows my project settings for an FDK10 release configuration that builds clean. It is from VS2008 but perhaps it can be of some use to you:

     

    http://www.weststreetconsulting.com/downloads/VC_FDK10_project_setting s.pdf

     

    Russ

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 1, 2012 5:57 AM   in reply to Russ Ward

    Also, I use /MD for a debug build as well and have had no problems, other than a pile of compiler warnings similar to:

     

    api.lib(apidebug.obj) : warning LNK4099: PDB 'fdk.pdb' was not found with '..\..\lib10\api.lib' or at 'c:\Program Files\Adobe\AdobeFrameMaker10\WestStreet\fdk.pdb'; linking object as if no debug info

     

    Hi Russ,

    yes these hundreds of linker warnings sind FDK 10 are very annoying, but there are no further problems with that.

    Are there any issues, disadvantages, with debugging your code, when using /MD switch in debug builds?

    Does debuggin work as expected?

    Markus

     

    Message was edited by: Wiedenmaier

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 1, 2012 6:04 AM   in reply to Wiedenmaier

    Hi Markus,

     

    Yes, so far debugging has worked fine with /MD.

     

    Russ

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 1, 2012 6:17 AM   in reply to Russ Ward

    thx Russ. Very interesting. I'll try it.

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 1, 2012 8:11 AM   in reply to nigel long

    are you sure struct.lib (and the right version of it) is linked to your project correctly?

    All these _SW_ symbols are part of struct.lib, and it seems this or the correct one isn't found

    If you want me to give you a hand, put your project (the vcxproj-file and your file where Sw-Eventhandler is defined is enough first) on a server directory or send it by a pm to info@practice-innovation.de.

    Bye

    Markus

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 1, 2012 9:02 AM   in reply to nigel long

    you're right. These linking errors has something to do with the 2010 SDK.

    I don't know exactly in which lib they are used.

    Try to remove this line, you added by Russ' recommendation:

    libcmt.lib,libcmtd.lib,libcd.lib,msvcrtd.lib

     

    The only lib I had to remove sometime is libcmt.lib.

    But at this moment I only guess.

     

    Please let me/us know the result.

    Markus

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 1, 2012 9:35 AM   in reply to nigel long

    do you have a stdafx.h? If so put it in there.

    Otherwise take anotherone, which is used in your basis API file, where F_ApiInitialized, F_ApiCommand or something like this is implemented.

    Markus

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 1, 2012 10:14 AM   in reply to Wiedenmaier

    Nigel,

     

    Apologies for one thing... that "FDK10" in the preprocessor definitions is not necessary. That's just something that I use here.

     

    Russ

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 2, 2012 5:09 AM   in reply to nigel long

    Hi Nigel,

     

    That's good news. Did you do this (from Markus):

     

    > > I change preprocessor definition from _DEBUG to NDEBUG and removed _USRDLL.

    > > But I think these two changes doesn't matter.

     

    I don't have any idea what those definitions do, but for me, those changes absolutely did matter. As soon as I did that, my clients began to initialize successfully. They were building without error before that, but had the same initialization problem you were seeing.

     

    Russ

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 2, 2012 7:01 AM   in reply to nigel long

    Nigel,

     

    Given the absence of documentation from Adobe, community support is sometimes your only hope. For sure, it has been my only hope at times. I'm very pleased to hear that you got things working, because I've been where you were.

     

    Russ

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points