- aggiunti EgtInterface e Language
- modificata finestra Copia Multipla
This commit is contained in:
@@ -0,0 +1,80 @@
|
||||
Imports System.Runtime.InteropServices
|
||||
Imports System.Security
|
||||
|
||||
Public Module EgtInterface
|
||||
|
||||
#If DEBUG Then
|
||||
Const EgtIntDll32 As String = "EgtBasisD32.dll"
|
||||
#Else
|
||||
Const EgtIntDll32 As String = "EgtBasisR32.dll"
|
||||
#End If
|
||||
|
||||
<DllImport(EgtIntDll32, CharSet:=CharSet.Unicode, EntryPoint:="EgtSetKey"), SuppressUnmanagedCodeSecurity()>
|
||||
Public Function EgtSetKey(sKey As String) As Boolean
|
||||
End Function
|
||||
|
||||
<DllImport(EgtIntDll32, CharSet:=CharSet.Unicode, EntryPoint:="EgtGetKeyLevel"), SuppressUnmanagedCodeSecurity()>
|
||||
Public Function EgtGetKeyLevel(nProd As Integer, nVer As Integer, nLev As Integer, ByRef nKLev As Integer) As Boolean
|
||||
End Function
|
||||
|
||||
<DllImport(EgtIntDll32, CharSet:=CharSet.Unicode, EntryPoint:="EgtGetKeyOptions"), SuppressUnmanagedCodeSecurity()>
|
||||
Public Function EgtGetKeyOptions(nProd As Integer, nVer As Integer, nLev As Integer,
|
||||
ByRef nOpt1 As UInteger, ByRef nOpt2 As UInteger) As Boolean
|
||||
End Function
|
||||
|
||||
<DllImport(EgtIntDll32, CharSet:=CharSet.Unicode, EntryPoint:="EgtGetKeyLeftDays"), SuppressUnmanagedCodeSecurity()>
|
||||
Public Function EgtGetKeyLeftDays(ByRef nLeftDays As Integer) As Boolean
|
||||
End Function
|
||||
|
||||
<DllImport(EgtIntDll32, CharSet:=CharSet.Unicode, EntryPoint:="EgtGetKeyAssLeftDays"), SuppressUnmanagedCodeSecurity()>
|
||||
Public Function EgtGetKeyAssLeftDays(ByRef nAssLeftDays As Integer) As Boolean
|
||||
End Function
|
||||
|
||||
<DllImport(EgtIntDll32, CharSet:=CharSet.Unicode, EntryPoint:="EgtGetKeyOptLeftDays"), SuppressUnmanagedCodeSecurity()>
|
||||
Public Function EgtGetKeyOptLeftDays(ByRef nOptLeftDays As Integer) As Boolean
|
||||
End Function
|
||||
|
||||
<DllImport(EgtIntDll32, CharSet:=CharSet.Unicode, EntryPoint:="EgtFreeMemory"), SuppressUnmanagedCodeSecurity()>
|
||||
Public Function EgtFreeMemory(sB As IntPtr) As Boolean
|
||||
End Function
|
||||
|
||||
<DllImport(EgtIntDll32, CharSet:=CharSet.Unicode, EntryPoint:="EgtLoadMessages"), SuppressUnmanagedCodeSecurity()>
|
||||
Public Function EgtLoadMessages(sMsgFilePath As String) As Boolean
|
||||
End Function
|
||||
|
||||
<DllImport(EgtIntDll32, CharSet:=CharSet.Unicode, EntryPoint:="EgtGetMsg"), SuppressUnmanagedCodeSecurity()>
|
||||
Private Function EgtGetMsg_32(nId As Integer) As IntPtr
|
||||
End Function
|
||||
Public Function EgtMsg(nId As Integer) As String
|
||||
Return Marshal.PtrToStringUni(EgtGetMsg_32(nId))
|
||||
' Non è necessario liberare la memoria nativa perchè usa un buffer statico
|
||||
End Function
|
||||
|
||||
<DllImport(EgtIntDll32, CharSet:=CharSet.Unicode, EntryPoint:="EgtInitLogger"), SuppressUnmanagedCodeSecurity()>
|
||||
Public Function EgtInitLogger(nDebug As Integer, sLogFilePath As String) As Boolean
|
||||
End Function
|
||||
|
||||
<DllImport(EgtIntDll32, CharSet:=CharSet.Unicode, EntryPoint:="EgtOutLog"), SuppressUnmanagedCodeSecurity()>
|
||||
Private Function EgtOutLog(sMsg As String, nDebugLevel As Integer) As Boolean
|
||||
End Function
|
||||
|
||||
<DllImport(EgtIntDll32, CharSet:=CharSet.Unicode, EntryPoint:="EgtGetStringUtf8FromIni"), SuppressUnmanagedCodeSecurity()>
|
||||
Private Function EgtGetStringUtf8FromIni_32(sSec As String, sKey As String, sDef As String, ByRef sVal As IntPtr, sIniFile As String) As Boolean
|
||||
End Function
|
||||
Public Function EgtGetStringUtf8FromIni(sSec As String, sKey As String, sDef As String, ByRef sVal As String, sIniFile As String) As Boolean
|
||||
Dim psVal As IntPtr
|
||||
Dim bOk As Boolean = EgtGetStringUtf8FromIni_32(sSec, sKey, sDef, psVal, sIniFile)
|
||||
If bOk Then
|
||||
sVal = Marshal.PtrToStringUni(psVal)
|
||||
EgtFreeMemory(psVal)
|
||||
Else
|
||||
sVal = String.Empty
|
||||
End If
|
||||
Return bOk
|
||||
End Function
|
||||
|
||||
<DllImport(EgtIntDll32, CharSet:=CharSet.Unicode, EntryPoint:="EgtWriteStringUtf8ToIni"), SuppressUnmanagedCodeSecurity()>
|
||||
Public Function EgtWriteStringUtf8toIni(sSec As String, sKey As String, sVal As String, sIniFile As String) As Boolean
|
||||
End Function
|
||||
|
||||
End Module
|
||||
@@ -38,25 +38,19 @@ Public Module IniFile
|
||||
Return GetPrivateProfileString(IpAppName, IpKeyName, IpDefault, IpString, m_sPath)
|
||||
End Function
|
||||
|
||||
'Public Function GetPrivateProfileLanguage(lpAppName As String, lpKeyName As String, lpFileName As String) As Language
|
||||
' Dim sVal As String = String.Empty
|
||||
' GetPrivateProfileString(lpAppName, lpKeyName, "", sVal, lpFileName)
|
||||
' Dim sItems() As String = sVal.Split(",".ToCharArray)
|
||||
' If sItems.Count() = 2 Then
|
||||
' Return New Language(sItems(0), sItems(1))
|
||||
' End If
|
||||
' Return Nothing
|
||||
'End Function
|
||||
Public Function GetPrivateProfileLanguage(lpAppName As String, lpKeyName As String, lpFileName As String) As Language
|
||||
Dim sVal As String = String.Empty
|
||||
GetPrivateProfileString(lpAppName, lpKeyName, "", sVal, lpFileName)
|
||||
Dim sItems() As String = sVal.Split(",".ToCharArray)
|
||||
If sItems.Count() = 2 Then
|
||||
Return New Language(sItems(0), sItems(1))
|
||||
End If
|
||||
Return Nothing
|
||||
End Function
|
||||
|
||||
'Public Function GetMainPrivateProfileLanguage(lpAppName As String, lpKeyName As String) As Language
|
||||
' Dim sVal As String = String.Empty
|
||||
' GetMainPrivateProfileString(lpAppName, lpKeyName, "", sVal)
|
||||
' Dim sItems() As String = sVal.Split(",".ToCharArray)
|
||||
' If sItems.Count() = 2 Then
|
||||
' Return New Language(sItems(0), sItems(1))
|
||||
' End If
|
||||
' Return Nothing
|
||||
'End Function
|
||||
Public Function GetMainPrivateProfileLanguage(lpAppName As String, lpKeyName As String) As Language
|
||||
Return GetPrivateProfileLanguage(lpAppName, lpKeyName, m_sPath)
|
||||
End Function
|
||||
|
||||
Public Function WriteMainPrivateProfileString(IpAppName As String, IpKeyName As String, ByRef IpString As String) As Boolean
|
||||
Return WritePrivateProfileString(IpAppName, IpKeyName, IpString, m_sPath)
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
Public Class Language
|
||||
|
||||
Private m_sName As String
|
||||
Public ReadOnly Property Name As String
|
||||
Get
|
||||
Return m_sName
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_sFilePath As String
|
||||
Public ReadOnly Property FilePath As String
|
||||
Get
|
||||
Return m_sFilePath
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Sub New(sName As String, sFilePath As String)
|
||||
m_sName = sName
|
||||
m_sFilePath = sFilePath
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
@@ -38,26 +38,6 @@ Public Module PluginIniFile
|
||||
Return GetPrivateProfileString(IpAppName, IpKeyName, IpDefault, IpString, m_sPath)
|
||||
End Function
|
||||
|
||||
'Public Function GetPrivateProfileLanguage(lpAppName As String, lpKeyName As String, lpFileName As String) As Language
|
||||
' Dim sVal As String = String.Empty
|
||||
' GetPrivateProfileString(lpAppName, lpKeyName, "", sVal, lpFileName)
|
||||
' Dim sItems() As String = sVal.Split(",".ToCharArray)
|
||||
' If sItems.Count() = 2 Then
|
||||
' Return New Language(sItems(0), sItems(1))
|
||||
' End If
|
||||
' Return Nothing
|
||||
'End Function
|
||||
|
||||
'Public Function GetMainPrivateProfileLanguage(lpAppName As String, lpKeyName As String) As Language
|
||||
' Dim sVal As String = String.Empty
|
||||
' GetMainPrivateProfileString(lpAppName, lpKeyName, "", sVal)
|
||||
' Dim sItems() As String = sVal.Split(",".ToCharArray)
|
||||
' If sItems.Count() = 2 Then
|
||||
' Return New Language(sItems(0), sItems(1))
|
||||
' End If
|
||||
' Return Nothing
|
||||
'End Function
|
||||
|
||||
Public Function WritePluginPrivateProfileString(IpAppName As String, IpKeyName As String, ByRef IpString As String) As Boolean
|
||||
Return WritePrivateProfileString(IpAppName, IpKeyName, IpString, m_sPath)
|
||||
End Function
|
||||
|
||||
Reference in New Issue
Block a user