Help - Search - Members - Calendar
Full Version: Skype COM API from a Service
Skype Community > English > Development, Betas and Skype Garage > Skype Public API
Mark_Hammans_
I am hoping someone can tell me what the 'CheckAPIClient' function does

I am trying to write a C# service for communicating with Skype

If I run the following code from an executable it works, but if I do it from within a service ( the same program just started differently ) I can see from DEBUGVIEW that it only gets as far as 'CheckAPIClient' and goes no further. I was having the same result using Windows Messaging which is why I decided to use the COM interface.

public class SkypeCom
{
private SKYPE4COMLib.SkypeClass m_Skype;

public SkypeCom()
{
m_Skype = new SkypeClass();

User u = m_Skype.CurrentUser;

System.Diagnostics.Debug.WriteLine( u.DisplayName );

}

}
ppmotskula
Both the API-enabled application and Skype Client must be run under the same user account. Running either as a service is currently not supported.
Mark_Hammans_
What I dont understand is why this does not work.

I have first run the application as an application, to make sure Skype is happy with that version and filename etc.

I start the service with the same user as Skype.

What else is 'CheckAPIClient' doing that I can try and handle?
carcass_
[quote=Mark_Hammans]What I dont understand is why this does not work.

I have first run the application as an application, to make sure Skype is happy with that version and filename etc.

I start the service with the same user as Skype.

What else is 'CheckAPIClient' doing that I can try and handle?[/quote]
It doesn't work because the API relies on Windows messaging, specifically, the WM_COPYDATA message, and that cannot be passed between two applications running in different desktop contexts. Even if you set up your service to run as the same account as Skype, it will not work.

About the only thing you could do is to create your own inter-process communications later (using TCP/IP, named pipes, etc.) to bridge the gap between your service and Skype.
Mark_Hammans_
Thanks for that - a very good explanation.

I am going to can the service idea for now.

Are there any future plans for Skype to use a different system of communication in the Windows environment ?
ppmotskula
[quote=Mark_Hammans]Are there any future plans for Skype to use a different system of communication in the Windows environment ?[/quote]None that I know of -- at least none to be implemented in immediately foreseeable future.
andreskaasik_
Note: for the following example I used a the "FireDaemon" software and Skype4COM.dll plus an example call.vbs script.

1. downloaded firedaemon from www.firedaemon.com
2. created a new service "SkypeTest"
3. opened "SkypeTest" property pages.
4. On the Program tab:

Console Application: checked
Executable: c:WINDOWSsystem32cscript.exe
Working directory: c:WINDOWSsystem32
Parameters: "C:Documents and Settings...ScriptsCall.vbs"

5. On the Settings tab:

Logon: user (with admin privs, same as logged in user account)
Interact with desktop: checked

6. Start and stop the service from DOS prompt
"net start skypetest"
"net stop skypetest"

.. works for me.
Mark_Hammans_
Thank you very much - what this proves is that it is possible and I shouldnt abandon the idea.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.