• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

How to check if API can connect to FM?

Participant ,
May 24, 2016 May 24, 2016

Copy link to clipboard

Copied

Hi in my FMClient I have the following method for checking if API is alive: bool FMClient::IsConnected() { return F_ApiAlive() > 0; } After I connect to FM with F_ApiStartUp the IsConnected method returns true. However, If the user closes the FM application then this method still continue returns true. How can I check if the FM application is alive and the FMClient is connected with it? Should I run and test an API call? e.g. Try to get the current active document or something else?

TOPICS
Scripting

Views

375

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Mentor , May 27, 2016 May 27, 2016

Yes, single-threaded is the normal state. There might be tricks around it, though. You would need to ask someone with a bit more programming expertise. I would ask the question here:

Yahoo! Groups

Russ

Votes

Translate

Translate
Mentor ,
May 24, 2016 May 24, 2016

Copy link to clipboard

Copied

Ch,

There might not be an active document. Maybe ask for the version (FP_VersionMajor)? Seems more reliable, although this is just a guess. I have not been in this situation before.

Russ

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
May 24, 2016 May 24, 2016

Copy link to clipboard

Copied

Thanks Russ.

I have tried to get the FP_UserName and it works.

However, because my code runs on a timer when the user selects text and do drag and drop then the API calls return nothing.

Is this because the FDK is single threaded or not?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Mentor ,
May 27, 2016 May 27, 2016

Copy link to clipboard

Copied

LATEST

Yes, single-threaded is the normal state. There might be tricks around it, though. You would need to ask someone with a bit more programming expertise. I would ask the question here:

Yahoo! Groups

Russ

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines