How to check if API can connect to FM?

Participant ,
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

218

Likes

Translate

Translate

Report

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

1 Correct Answer

Mentor , May 27, 2016
Russ Ward Mentor , 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

Likes

Translate

Translate
Jump to answer Jump to answer
Mentor ,
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

Likes

Translate

Translate

Report

Report
Reply
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Participant ,
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?

Likes

Translate

Translate

Report

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

Copy link to clipboard

Copied

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

Likes

Translate

Translate

Report

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