Skip to main content
Ch__Efstathios
Inspiring
May 24, 2016
Answered

How to check if API can connect to FM?

  • May 24, 2016
  • 1 reply
  • 547 views

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?

This topic has been closed for replies.
Correct answer Russ Ward

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

1 reply

Legend
May 24, 2016

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

Ch__Efstathios
Inspiring
May 24, 2016

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?

Russ WardCorrect answer
Legend
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