Page 1 of 1

C/C++ API Function Question

Posted: Wed Mar 20, 2013 2:52 pm
by George Regateiro
I have tried decomposing the DLL for the C API looking for a function that mimics the Disconnect Clients option under Server Manager window of Architect, but I have not found anything that looks similar. There are functions that seem API specific to kill the current user session in the API, but not one that I can disconnect a client (or set) of my choosing. Is there one that I have missed that will perform the client disconnect option?

Re: C/C++ API Function Question

Posted: Wed Mar 20, 2013 5:34 pm
by Mike Cowie
Hi George:

I had to ask for this originally - not sure why it's not been documented since I asked back in 2000.

This is an old VBA/VB6 declaration, which shouldn't be too hard to rework for C/C++:

Code: Select all

Declare Function TM1ClientDisconnect Lib "tm1api.dll" (ByVal hPool As Long, ByVal hServer As Long, ByVal sClientName As Long) As Long
I believe it will disconnect all connections for that specified user (provided you're an Admin).

Regards,
Mike

Re: C/C++ API Function Question

Posted: Tue Mar 11, 2014 4:03 pm
by Firefly007
Hello Mike,

TM1ClientDisconnect is not available in TM1 10.2 API list . Is there is any alternate function need to be used to disconnect All active clients?

Thanks,

Re: C/C++ API Function Question

Posted: Tue Mar 11, 2014 5:56 pm
by Mike Cowie
Hi Firefly007:

No, I don't know of an alternative. As I said below, this function has been around since 2000, but has never been officially documented by Applix, Cognos and now IBM. Why they haven't documented it is beyond me, but you should be able to use it to disconnect all clients (one at a time). It should still be available for use as long as the VB/C TM1 API exists/is supported.

Regards,
Mike

Re: C/C++ API Function Question

Posted: Wed Mar 12, 2014 9:49 am
by Harvey
TM1ClientDisconnect definitely exists in the 10.1 API dll.

I don't have 10.2 installed on this machine, but I'd be surprised if it was removed, since the front end calls it!

There is also a function called TM1ClientDisconnectEx, but since I'm just "peeking" at the dll using Dependency Walker, I don't know what the purpose of that is.

If you want to know more about using Dependency Walker to look at the function signatures of the API, it's covered in this blog article.

You will be able to use it to verify that 10.2 includes the function call, but you will get a lot of other interesting information from it as well.