Ik heb de volgende code:
sub main:
in clsSettings:
Als ik dit uitvoer krijg ik als foutmelding: ByRef Argument Type Mismatch.
En dan deze functie ge-hilite:
Public Function GetFromIniFile(What As INI_OBJECT) As String
GetFromIniFile = ParseIniFile(What)
End Function
Ik vermoed dat die ENUM niet als een INTEGER geïnterpreteerd wordt door de functie ParseIniFile.
Maar in de ENUM heb ik wel dit staan:
MAILSERVICE_FACTUUR = 6
Dus zou die functie toch Integer "6" moeten doorgeven??
sub main:
Visual Basic 6:
1
2
3
4
5
6
7
8
| Sub Main() Dim myobj As clsSettings Set myobj = New clsSettings MsgBox myobj.GetFromIniFile(MAILSERVICE_FACTUUR) Set myobj = Nothing End Sub |
in clsSettings:
Visual Basic 6:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
| Option Explicit Public Enum INI_OBJECT INI_ID = 1 TMS_BEVESTIGING = 2 INCIDENT_BEVESTIGING = 3 TMS_FACTUUR = 4 INCIDENT_FACTUUR = 5 MAILSERVICE_FACTUUR = 6 End Enum Private m_strIniFile As String Private Sub Class_Initialize() m_strIniFile = App.Path & "\FactuurTool.ini" End Sub Private Function ParseIniFile(LineNumber As Integer) As String Dim intFp As Integer Dim strContents As String Dim arrContents() As String Dim i As Integer i = 1 intFp = FreeFile Open m_strIniFile For Input As #intFp Do While Not EOF(intFp) Line Input #intFp, strContents If LineNumber = i Then arrContents = Split(strContents, "=") ParseIniFile = arrContents(1) End If i = i + 1 Loop Close #intFp End Function Public Function GetFromIniFile(What As INI_OBJECT) As String GetFromIniFile = ParseIniFile(What) End Function |
Als ik dit uitvoer krijg ik als foutmelding: ByRef Argument Type Mismatch.
En dan deze functie ge-hilite:
Public Function GetFromIniFile(What As INI_OBJECT) As String
GetFromIniFile = ParseIniFile(What)
End Function
Ik vermoed dat die ENUM niet als een INTEGER geïnterpreteerd wordt door de functie ParseIniFile.
Maar in de ENUM heb ik wel dit staan:
MAILSERVICE_FACTUUR = 6
Dus zou die functie toch Integer "6" moeten doorgeven??
[ Voor 2% gewijzigd door DPLuS op 01-09-2004 15:05 . Reden: typo ]