0
votes

I'm getting an exception when checking if a user is logged out.

Code snippet:

if(skype.CurrentUserStatus == TUserStatus.cusLoggedOut)
{
    MessageBox.Show("Bitte melde dich in Skype an.", "Fehler", MessageBoxButtons.OK, MessageBoxIcon.Error);
    System.Windows.Forms.Application.Exit();
}

But if i'm logged out and try to debug it, i get a exception.

Ein Ausnahmefehler des Typs "System.Runtime.InteropServices.COMException" ist in alphasn0w.exe aufgetreten.

Zusätzliche Informationen: Not attached.

Translation:

An exception of type 'System.Runtime.InteropServices.COMException' occurred in alphasn0w.exe.

Additional information: Not attached.

How can I fix this?

1
Which line causes the Exception? - MikeG
This SO thread might offer some insights on how to debug COM Exceptions. This could be as simple as a user rights issue that's resolved by running VS as admin. stackoverflow.com/questions/4281425/… - SWalters
@MikeG the first line of the code snippet. - Underbytex
Is there an alternative, to check if the user is logged out? - Underbytex
What's the type of the exception thrown at line 1? - Antony Koch

1 Answers

0
votes

This means you're not attached to Skype.

You'll want to do:

Skype skype = new Skype();
skype.attach(7, true);

The "true" means it'll wait until the user has clicked "Allow", then continue with your code.