Impossibile applicare 'System.Runtime.InteropServices.DllImportAttribute' al metodo 'AddHandler', 'RemoveHandler' o 'RaiseEvent'

Aggiornamento: novembre 2007

'System.Runtime.InteropServices.DllImportAttribute' cannot be applied to 'AddHandler', 'RemoveHandler', or 'RaiseEvent' methods

L'attributo DllImportAttribute è stato applicato a una dichiarazione di metodo AddHandler, RemoveHandler o RaiseEvent. Questo attributo può essere utilizzato solo con una funzione Function o Sub vuota.

ID errore: BC31531

Per correggere l'errore

  • Rimuovere l'attributo DllImportAttribute dalla dichiarazione di metodo.

Vedere anche

Riferimenti

Istruzione Event

AddHandler

RemoveHandler

RaiseEvent

DllImportAttribute