By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,566 Members | 1,794 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,566 IT Pros & Developers. It's quick & easy.

Upgrade VB6 Error

P: n/a
Hi guys I am having the following problem upgrading a vb6 application, I
have click the link as it suggested and I have search the net only to become
even more confussed! HELP!!!

Error: - 'AddressOf' expression cannot be converted to 'Integer' because
'Integer' is not a delegate type.

Code

Declare Function lineInitializeEx Lib "tapi32.dll" Alias "lineInitializeExA"
(ByRef lphLineApp As Integer, ByVal hInstance As Integer, ByVal lpfnCallback
As Integer, ByVal lpszFriendlyAppName As String, ByRef lpdwNumDevs As
Integer, ByRef lpdwAPIVersion As Integer, ByRef lpLineInitializeExParams As
LINEINITIALIZEEXPARAMS) As Integer

'UPGRADE_WARNING: Add a delegate for AddressOf mTAPIvb.LineCallbackProc
Click for more:
'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="vbup1048"'

rc = lineInitializeEx(m_hLineApp, VB6.GetHInstance.ToInt32, AddressOf
mTAPIvb.LineCallbackProc,
System.Reflection.Assembly.GetExecutingAssembly.Ge tName.Name, m_numLines,
m_HiAPI, lip)

Nov 21 '05 #1
Share this Question
Share on Google+
6 Replies


P: n/a
Hi,

http://msdn.microsoft.com/library/de...l/vbup1048.asp

Ken
---------------------
"Michael Turner" <fi*****@m-turner.co.uk> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
Hi guys I am having the following problem upgrading a vb6 application, I
have click the link as it suggested and I have search the net only to become
even more confussed! HELP!!!

Error: - 'AddressOf' expression cannot be converted to 'Integer' because
'Integer' is not a delegate type.

Code

Declare Function lineInitializeEx Lib "tapi32.dll" Alias "lineInitializeExA"
(ByRef lphLineApp As Integer, ByVal hInstance As Integer, ByVal lpfnCallback
As Integer, ByVal lpszFriendlyAppName As String, ByRef lpdwNumDevs As
Integer, ByRef lpdwAPIVersion As Integer, ByRef lpLineInitializeExParams As
LINEINITIALIZEEXPARAMS) As Integer

'UPGRADE_WARNING: Add a delegate for AddressOf mTAPIvb.LineCallbackProc
Click for more:
'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="vbup1048"'

rc = lineInitializeEx(m_hLineApp, VB6.GetHInstance.ToInt32, AddressOf
mTAPIvb.LineCallbackProc,
System.Reflection.Assembly.GetExecutingAssembly.Ge tName.Name, m_numLines,
m_HiAPI, lip)


Nov 21 '05 #2

P: n/a
Hi,

http://msdn.microsoft.com/library/de...l/vbup1048.asp

Ken
---------------------
"Michael Turner" <fi*****@m-turner.co.uk> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
Hi guys I am having the following problem upgrading a vb6 application, I
have click the link as it suggested and I have search the net only to become
even more confussed! HELP!!!

Error: - 'AddressOf' expression cannot be converted to 'Integer' because
'Integer' is not a delegate type.

Code

Declare Function lineInitializeEx Lib "tapi32.dll" Alias "lineInitializeExA"
(ByRef lphLineApp As Integer, ByVal hInstance As Integer, ByVal lpfnCallback
As Integer, ByVal lpszFriendlyAppName As String, ByRef lpdwNumDevs As
Integer, ByRef lpdwAPIVersion As Integer, ByRef lpLineInitializeExParams As
LINEINITIALIZEEXPARAMS) As Integer

'UPGRADE_WARNING: Add a delegate for AddressOf mTAPIvb.LineCallbackProc
Click for more:
'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="vbup1048"'

rc = lineInitializeEx(m_hLineApp, VB6.GetHInstance.ToInt32, AddressOf
mTAPIvb.LineCallbackProc,
System.Reflection.Assembly.GetExecutingAssembly.Ge tName.Name, m_numLines,
m_HiAPI, lip)


Nov 21 '05 #3

P: n/a
Hi Ken

Thanks I have already looked at this article and it has confused me even
more is there any more advice that I can be given?

Thanks,
Mike.

"Ken Tucker [MVP]" <vb***@bellsouth.net> wrote in message
news:OQ**************@TK2MSFTNGP12.phx.gbl...
Hi,

http://msdn.microsoft.com/library/de...l/vbup1048.asp
Ken
---------------------
"Michael Turner" <fi*****@m-turner.co.uk> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
Hi guys I am having the following problem upgrading a vb6 application, I
have click the link as it suggested and I have search the net only to become even more confussed! HELP!!!

Error: - 'AddressOf' expression cannot be converted to 'Integer' because
'Integer' is not a delegate type.

Code

Declare Function lineInitializeEx Lib "tapi32.dll" Alias "lineInitializeExA" (ByRef lphLineApp As Integer, ByVal hInstance As Integer, ByVal lpfnCallback As Integer, ByVal lpszFriendlyAppName As String, ByRef lpdwNumDevs As
Integer, ByRef lpdwAPIVersion As Integer, ByRef lpLineInitializeExParams As LINEINITIALIZEEXPARAMS) As Integer

'UPGRADE_WARNING: Add a delegate for AddressOf mTAPIvb.LineCallbackProc
Click for more:
'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="vbup1048"'

rc = lineInitializeEx(m_hLineApp, VB6.GetHInstance.ToInt32, AddressOf
mTAPIvb.LineCallbackProc,
System.Reflection.Assembly.GetExecutingAssembly.Ge tName.Name, m_numLines,
m_HiAPI, lip)



Nov 21 '05 #4

P: n/a
Hi Ken

Thanks I have already looked at this article and it has confused me even
more is there any more advice that I can be given?

Thanks,
Mike.

"Ken Tucker [MVP]" <vb***@bellsouth.net> wrote in message
news:OQ**************@TK2MSFTNGP12.phx.gbl...
Hi,

http://msdn.microsoft.com/library/de...l/vbup1048.asp
Ken
---------------------
"Michael Turner" <fi*****@m-turner.co.uk> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
Hi guys I am having the following problem upgrading a vb6 application, I
have click the link as it suggested and I have search the net only to become even more confussed! HELP!!!

Error: - 'AddressOf' expression cannot be converted to 'Integer' because
'Integer' is not a delegate type.

Code

Declare Function lineInitializeEx Lib "tapi32.dll" Alias "lineInitializeExA" (ByRef lphLineApp As Integer, ByVal hInstance As Integer, ByVal lpfnCallback As Integer, ByVal lpszFriendlyAppName As String, ByRef lpdwNumDevs As
Integer, ByRef lpdwAPIVersion As Integer, ByRef lpLineInitializeExParams As LINEINITIALIZEEXPARAMS) As Integer

'UPGRADE_WARNING: Add a delegate for AddressOf mTAPIvb.LineCallbackProc
Click for more:
'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="vbup1048"'

rc = lineInitializeEx(m_hLineApp, VB6.GetHInstance.ToInt32, AddressOf
mTAPIvb.LineCallbackProc,
System.Reflection.Assembly.GetExecutingAssembly.Ge tName.Name, m_numLines,
m_HiAPI, lip)



Nov 21 '05 #5

P: n/a
You need to define a delegate for the Callback procedure lineCallbackProc.
Here's how your declaration would look like:

Public Delegate Function lineCallbackProc( _
ByVal dwDevice As Integer,
ByVal dwMsg As Integer, _
ByVal dwCallbackInst As Integer, _
ByVal dwParam1 As Integer,
ByVal dwParam2 As Integer, _
ByVal dwParam3 As Integer) As Integer

Declare Function lineInitializeEx Lib "tapi32.dll" _
Alias "lineInitializeExA" (ByRef lphLineApp As Integer, _
ByVal hInstance As Integer, _
ByVal lpfnCallback As lineCallbackProc, _
ByVal lpszFriendlyAppName As String, _
ByRef lpdwNumDevs As Integer, _
ByRef lpdwAPIVersion As Integer, _
ByRef lpLineInitializeExParams As LINEINITIALIZEEXPARAMS) _
As Integer
hope that helps..
Imran.
"Michael Turner" <fi*****@m-turner.co.uk> wrote in message
news:eA**************@TK2MSFTNGP09.phx.gbl...
Hi Ken

Thanks I have already looked at this article and it has confused me even
more is there any more advice that I can be given?

Thanks,
Mike.

"Ken Tucker [MVP]" <vb***@bellsouth.net> wrote in message
news:OQ**************@TK2MSFTNGP12.phx.gbl...
Hi,

http://msdn.microsoft.com/library/de...l/vbup1048.asp

Ken
---------------------
"Michael Turner" <fi*****@m-turner.co.uk> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
Hi guys I am having the following problem upgrading a vb6 application, I
have click the link as it suggested and I have search the net only to

become
even more confussed! HELP!!!

Error: - 'AddressOf' expression cannot be converted to 'Integer' because 'Integer' is not a delegate type.

Code

Declare Function lineInitializeEx Lib "tapi32.dll" Alias

"lineInitializeExA"
(ByRef lphLineApp As Integer, ByVal hInstance As Integer, ByVal

lpfnCallback
As Integer, ByVal lpszFriendlyAppName As String, ByRef lpdwNumDevs As
Integer, ByRef lpdwAPIVersion As Integer, ByRef lpLineInitializeExParams

As
LINEINITIALIZEEXPARAMS) As Integer

'UPGRADE_WARNING: Add a delegate for AddressOf mTAPIvb.LineCallbackProc
Click for more:
'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="vbup1048"'

rc = lineInitializeEx(m_hLineApp, VB6.GetHInstance.ToInt32, AddressOf
mTAPIvb.LineCallbackProc,
System.Reflection.Assembly.GetExecutingAssembly.Ge tName.Name, m_numLines, m_HiAPI, lip)



Nov 21 '05 #6

P: n/a
You need to define a delegate for the Callback procedure lineCallbackProc.
Here's how your declaration would look like:

Public Delegate Function lineCallbackProc( _
ByVal dwDevice As Integer,
ByVal dwMsg As Integer, _
ByVal dwCallbackInst As Integer, _
ByVal dwParam1 As Integer,
ByVal dwParam2 As Integer, _
ByVal dwParam3 As Integer) As Integer

Declare Function lineInitializeEx Lib "tapi32.dll" _
Alias "lineInitializeExA" (ByRef lphLineApp As Integer, _
ByVal hInstance As Integer, _
ByVal lpfnCallback As lineCallbackProc, _
ByVal lpszFriendlyAppName As String, _
ByRef lpdwNumDevs As Integer, _
ByRef lpdwAPIVersion As Integer, _
ByRef lpLineInitializeExParams As LINEINITIALIZEEXPARAMS) _
As Integer
hope that helps..
Imran.
"Michael Turner" <fi*****@m-turner.co.uk> wrote in message
news:eA**************@TK2MSFTNGP09.phx.gbl...
Hi Ken

Thanks I have already looked at this article and it has confused me even
more is there any more advice that I can be given?

Thanks,
Mike.

"Ken Tucker [MVP]" <vb***@bellsouth.net> wrote in message
news:OQ**************@TK2MSFTNGP12.phx.gbl...
Hi,

http://msdn.microsoft.com/library/de...l/vbup1048.asp

Ken
---------------------
"Michael Turner" <fi*****@m-turner.co.uk> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
Hi guys I am having the following problem upgrading a vb6 application, I
have click the link as it suggested and I have search the net only to

become
even more confussed! HELP!!!

Error: - 'AddressOf' expression cannot be converted to 'Integer' because 'Integer' is not a delegate type.

Code

Declare Function lineInitializeEx Lib "tapi32.dll" Alias

"lineInitializeExA"
(ByRef lphLineApp As Integer, ByVal hInstance As Integer, ByVal

lpfnCallback
As Integer, ByVal lpszFriendlyAppName As String, ByRef lpdwNumDevs As
Integer, ByRef lpdwAPIVersion As Integer, ByRef lpLineInitializeExParams

As
LINEINITIALIZEEXPARAMS) As Integer

'UPGRADE_WARNING: Add a delegate for AddressOf mTAPIvb.LineCallbackProc
Click for more:
'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="vbup1048"'

rc = lineInitializeEx(m_hLineApp, VB6.GetHInstance.ToInt32, AddressOf
mTAPIvb.LineCallbackProc,
System.Reflection.Assembly.GetExecutingAssembly.Ge tName.Name, m_numLines, m_HiAPI, lip)



Nov 21 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.