zit hier met een probleempje in Visual Basic 6:
Ik heb een programma gemaakt dat met een handscanner werkt. Nu is het zo dat als je met de handscanner een containernr scanned, het programma de bij behorende orders op die containers laat zien op de handscanner.
def in beide projecten (app en dll driver:
def in project van applicatie
programma roept de functie aan:
de functie:
de functie hierboven roept de navbiespl dll aan waar lookupUitval functie inzit:
Maar ik krijg een mismatch error: ByRef argument type mismatch
Maar de definitie van typArtVor zit zowel als in het programma als in de dll.
Zie ik iets over het hoofd waar het misgaat
(op msdn vond ik een document over deze error. Het ging over als je Dim <var> doet zonder een type te defineren. Maar in het project als in de dll is typArtVor gedeclareerd)
Ik heb een programma gemaakt dat met een handscanner werkt. Nu is het zo dat als je met de handscanner een containernr scanned, het programma de bij behorende orders op die containers laat zien op de handscanner.
def in beide projecten (app en dll driver:
Visual Basic:
1
2
3
4
5
| Type typArtVor por As String 'por-nummer art As String 'Artikel-nummer per As String 'Verwacht percentage goedkeur End Type |
def in project van applicatie
Visual Basic:
1
2
3
4
5
6
7
| Type typUitval con As String ArtPorLijst() As typArtVor ArtPorAantal As Integer End Type Static strUitval(MAX_PDT) As typUitval |
programma roept de functie aan:
Visual Basic:
1
2
3
| AddMessage Str(idc) + " : Container " + strUitval(pdt).con, False lookupUitval strUitval(pdt).con, strUitval(pdt).ArtPorLijst, strUitval(pdt).ArtPorAantal |
de functie:
Visual Basic:
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
| Private Function lookupUitval(ByVal cnr As String, _ ByRef artVorLst() As typArtVor, _ ByRef artVorAantal As Integer) On Error GoTo Errorhandler Dim lTable2 As NavBiesPL.ContainerInhoud Set lTable2 = New NavBiesPL.ContainerInhoud If lTable2.lookupUitval(cnr, artVorLst, artVorAantal) Then lookupUitval = True Else lookupUitval = False End If Set lTable2 = Nothing Exit Function Errorhandler: If Err.Number Then AddMessage "Bij lookupUitval fout " & Str(Err.Number) & " geconstateerd", True lookupUitval = False End If Resume Next End Function |
de functie hierboven roept de navbiespl dll aan waar lookupUitval functie inzit:
Visual Basic:
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
| Public Function lookupUitval(ByVal conNr As String, _ ByRef artVorLst() As typArtVor, _ ByRef artVorAantal As Integer) As Boolean On Error GoTo Error_Handler mRecordSet.SetSearchField "Container Nr.", conNr artVorAantal = 0 If (mRecordSet.Query(ObjectName)) Then Do ReDim Preserve artVorLst(artVorAantal + 1) mRecordSet.GetFieldData artVorLst(artVorAantal).art, "Artikel Nr." mRecordSet.GetFieldData artVorLst(artVorAantal).por, "POR-Nummer." mRecordSet.GetFieldData artVorLst(artVorAantal).per, "Perc Goed" artVorAantal = artVorAantal + 1 Loop Until mRecordSet.MoveNext = False lookupUitval = True Else 'container niet gevonden lookupUitval = False End If Exit Function Error_Handler: lookupUitval = False Err.Source = ERRORSOURCE & " (lookupUitval method)" Call WriteLogInfo(vbTechnischeFout, Err.Number, Err.Source, Err.Description) End Function |
Maar ik krijg een mismatch error: ByRef argument type mismatch
Maar de definitie van typArtVor zit zowel als in het programma als in de dll.
Zie ik iets over het hoofd waar het misgaat
(op msdn vond ik een document over deze error. Het ging over als je Dim <var> doet zonder een type te defineren. Maar in het project als in de dll is typArtVor gedeclareerd)
[ Voor 13% gewijzigd door PoweRoy op 29-05-2006 14:04 ]
[This space is for rent]