Bonjour à tous;
Je travail sous Visual Studio 2005.
Dans mon programme je fais appel à une dll, que j'implémente de cette manière:
Mais arrivé au niveau de "Test .DevicePowerOff()", une exception apparait :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12 Imports Lack Public Shared Function PowerOff() As Boolean Dim Test As Lack.Automation = New Lack.Automation Test = Nothing Test = New Lack.Automation Test .DevicePowerOff() Test .DevicePowerOn() Return True End Function
Error: Unable to cast COM object of type 'Lack.AutomationClass' to interface type 'Lack.ILackAutomation'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{042BF544-3A27-11D3-9421-006008C66DB9}' failed due to the following error: No such interface supported (Exception from HRESULT: 0x80004002 (E_NOINTERFACE)).in CLASS: Class name not provided..., Test: InvokeDispMethod
Il semble que l'interface ILackAutomation fournit par la dll ne soit pas supporté.
Je ne sais pas quoi faire pour résoudre ce problème.
Merci de votre aide.
Partager