Twitter iPhone pliant OnePlus 11 PS5 Disney+ Orange Livebox Windows 11

Bonne déclaration mais quand meme une erreur !!

2 réponses
Avatar
AlexC
J'ai ceci :

<DllImport("nidaq32.dll", SetLastError:=True)> Public Static Function
AO_VWrite(ByVal a As Integer, ByVal b As Integer, ByVal c As Double) As
Integer
End Function

Mais l'IDE me souligne le nom de ma fonction et m'affiche "Les méthodes ne
peuvent pas être déclarées 'Static'" ... Alors que c'est une fonction.
ceci est suite à une erreur générée lors de mon éxécution qui disait :
"l'élément PInvoke (champ, méthode) doit être de type Static"

Merci d'avance pour vos réponses

AlexC.

2 réponses

Avatar
Patrick Philippot
AlexC wrote:
<DllImport("nidaq32.dll", SetLastError:=True)> Public Static Function
AO_VWrite(ByVal a As Integer, ByVal b As Integer, ByVal c As Double)
As Integer
End Function



Bonjour,

En VB .Net static se dit Shared

<DllImport("nidaq32.dll", SetLastError:=True)> Public Shared Function
AO_VWrite(ByVal a As Integer, ByVal b As Integer, ByVal c As Double)
As Integer
End Function

--
Patrick Philippot - Microsoft MVP
MainSoft Consulting Services
www.mainsoft.fr
Avatar
AlexC
Ah ben voilà :) merci !

"Patrick Philippot" a écrit dans le
message de news: u$6KCUH$
AlexC wrote:
<DllImport("nidaq32.dll", SetLastError:=True)> Public Static Function
AO_VWrite(ByVal a As Integer, ByVal b As Integer, ByVal c As Double)
As Integer
End Function



Bonjour,

En VB .Net static se dit Shared

<DllImport("nidaq32.dll", SetLastError:=True)> Public Shared Function
AO_VWrite(ByVal a As Integer, ByVal b As Integer, ByVal c As Double)
As Integer
End Function

--
Patrick Philippot - Microsoft MVP
MainSoft Consulting Services
www.mainsoft.fr