I'm starting a project to integrate a third party add-in from SagePay to our in-house Access database and unsure on some of the basics. I've completed the following steps but not clear on where the initial problem lies. Any assistance appreciated..
1. Discovered that I need a type library (tlb file) for the dll so I generated file using regasm (have .net framework 4.5 installed which is a listed minimum requirement)
(regasm.exe in c:\windows\microsoft.net\f
4.0.30319 = v4.5 folder after upgrade by all accounts)
regasm c:\sagepay\guardian\bin\Integral.Library.GuardianClient.dll /tlb
2. Added a reference to the add-in to vba project
3. Declared function call for the add-in using documentation:
Public Declare Function Process Lib "c:\sagepay\guardian\bin" ( _
ByVal transactionType As TRANSACTIONHOOK_TRANSACTIONTYPE, _
ByVal transactionAmount As Integer, _
ByRef tillInfo As TillInformation, _
ByRef transInfo As TransactionInfo) _
4. This is where my knowledge gets a bit sketchy; I assumed the add-in would include the tillinformation type definition which I checked in the object browser but this is not the case as it shows no members?
Hence, declared a VBA type as shown to match the documentation although documentation does not specify actual data types. I've tried varying strings / integers for some of the type declarations with no effect.
Public Type TillInformation
merchantname As String
address1 As String
address2 As String
address3 As String
address4 As String
phonenumber As String
sitenumber As String
tillnumber As String
receiptnumber As String
operatorid As String
5. Now when I try to call the function fro a test form, I get a type mismatch with 'tillinformation' parameter so it’s obviously not happy with the declaration..
I don't know if the issue is with the add-in registration or the way I'm trying to declare the necessary types etc. so desperately in need of some guidance please! Thanks