Problème cration de dll sous vb.net

darkmalcolm Messages postés 6 Date d'inscription vendredi 18 août 2006 Statut Membre Dernière intervention 25 juin 2012 - 20 janv. 2009 à 10:21
darkmalcolm Messages postés 6 Date d'inscription vendredi 18 août 2006 Statut Membre Dernière intervention 25 juin 2012 - 20 janv. 2009 à 10:23
Bonjour je cherche a créer une dll en vb.net, mais lorsque j'essai de l'utilisé j'ai un message d'erreur me disant que je n'ai pas de point d'entré .

Imports System.Runtime.InteropServices

Namespace cRechCli

Public Class clsRechercheClient

<structlayout(layoutkind.sequential, charset:="CharSet.Ansi)"> Public Structure Client

<marshalas(unmanagedtype.byvalarray, sizeconst:="14)"> Dim CLIENT1 As Char() 'Nom

End Structure

Private Cli As Client

Private lNbClient As Long
Private iReclength As Integer
Private fileReader As System.IO.FileStream

ReadOnly Property NbCli() As Long
Get
Return lNbClient
End Get
End Property

Private Sub closeCli()
fileReader.Close()
End Sub

Private Sub ouvCli(ByVal sRootBase As String, Optional ByVal sTypeCli As Integer = 0)

iReclength = Marshal.SizeOf(Cli)

fileReader = System.IO.File.Open(sRootBase & "\CLIENT" & sTypeCli & ".d", IO.FileMode.Open, IO.FileAccess.ReadWrite, IO.FileShare.ReadWrite)
readCli(1)
If fileReader.Length <iReclength Then lNbClient 1 Else lNbClient = Math.Round((fileReader.Length / iReclength), 0)

End Sub

Private Sub readCli(ByVal iNumFiche As Long)

Dim buffer(iReclength - 1) As Byte
Dim MyGC As GCHandle

fileReader.Seek((iNumFiche - 1) * iReclength, IO.SeekOrigin.Begin)
Dim p As Long = fileReader.Position
fileReader.Read(buffer, 0, buffer.Length)
MyGC = GCHandle.Alloc(buffer, GCHandleType.Pinned)
Cli = DirectCast(Marshal.PtrToStructure(MyGC.AddrOfPinnedObject, GetType(Client)), Client)
MyGC.Free()

End Sub

Function ClientExiste(ByVal sNomClient As String, ByVal sPrenomClient As String, _
ByVal sRootBase As String) As Long

Dim lIndiceFicheCli As Long
Dim lRetour As Long = 0

ouvCli(sRootBase)

For lIndiceFicheCli = 1 To NbCli

readCli(lIndiceFicheCli)

If Trim(sNomClient.ToUpper) Trim(Cli.CLIENT1) And Trim(sPrenomClient.ToUpper) Trim(Cli.CLIENT2) Then

lRetour = lIndiceFicheCli : Exit For

End If

Next lIndiceFicheCli

closeCli()

Return lRetour

End Function

End Class</marshalas(unmanagedtype.byvalarray,></structlayout(layoutkind.sequential,>

1 réponse

darkmalcolm Messages postés 6 Date d'inscription vendredi 18 août 2006 Statut Membre Dernière intervention 25 juin 2012
20 janv. 2009 à 10:23
Bonjour je cherche a créer une dll en vb.net, mais lorsque j'essai de l'utilisé j'ai un message d'erreur me disant que je n'ai pas de point d'entré .

ps desolé pour mon premier post !
0
Rejoignez-nous