|
-
May 18th, 2004, 01:29 PM
#1
Thread Starter
Addicted Member
Delegate Integer
I'm upgrading an vb6 application to vb.net. And there were a host of Build Errrors. One of them is on the use of a callback function. I'm getting the following error "Address cannot be converted to integer because integer is not a delegate integer". The code that's being referenced is:
iRC = EntEnumN(ghSelect, HYP_ID_ACCTLISTENTRY, sigAcctList, AddressOf EnumAcctListEntriesCB, lParam, 0)
The callback function is:
Public Function EnumAcctListEntriesCB(ByVal hSelect As Integer, ByVal sigRecd As Integer, ByVal sigKey As Integer, ByVal lParam As Integer, ByRef apis As APISTRUCT) As Short
If I change the callback function to:
Public Delegate Function EnumAcctListEntriesCB(ByVal hSelect As Integer, ByVal sigRecd As Integer, ByVal sigKey As Integer, ByVal lParam As Integer, ByRef apis As APISTRUCT) As Short , then I get additional errors "Declared Expected" for the un
Public Delegate Function EnumAcctListEntriesCB(ByVal hSelect As Integer, ByVal sigRecd As Integer, ByVal sigKey As Integer, ByVal lParam As Integer, ByRef apis As APISTRUCT) As Short
Dim sListEntry As String
Dim iRC As Integer
Dim sigEntry As Integer
sListEntry = Space(HYP_SIZEFULLACCT + 1)
If lParam = 1 Then 'Dynamic List
iRC = EntQueryStrN(ghSelect, HYP_ID_ACCOUNTS, HYP_ACCT_FULLNAME, sigKey, HYP_NONE, Len(sListEntry), sListEntry, 0)
sListEntry = CB(sListEntry)
Form1.DefInstance.List2.Items.Add(sListEntry)
' frmAcctEntList.lstEntries.AddItem sListEntry$
Else 'Fixed List
' trick: sigKey and sigRecd are flip-flopped
' Query for entry_sig, then query ACCOUNTS using entry_sig
iRC = EntQueryN(ghSelect, HYP_ID_ACCTLISTENTRY, HYP_ENTRY_SIG, sigKey, sigRecd, Len(sigEntry), sigEntry, 0)
iRC = EntQueryStrN(ghSelect, HYP_ID_ACCOUNTS, HYP_NAME, sigEntry, HYP_NONE, Len(sListEntry), sListEntry, 0)
sListEntry = CB(sListEntry)
Form1.DefInstance.List2.Items.Add(sListEntry)
frmData.DefInstance.List1.Items.Add(sListEntry)
End If
EnumAcctListEntriesCB = 0
End Function
Any help appreciated.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|