0

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?

Community
  • 1
  • 1
Underbytex
  • 379
  • 1
  • 3
  • 5

1 Answers1

0

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.

JustLloyd
  • 129
  • 2
  • 8