Groups | Blog | Home
all groups > vb.net upgrade > september 2005 >

vb.net upgrade : System.StackOverflowException


Beginner
9/15/2005 3:12:02 PM
Hello,
I got an error message that says, "An unhandled exception of type
'System.StackOverflowException' occurred in Porject1.exe", when I run the
program upgraded from VB6. When the error occurs, the debugger is pointing at
the following function;

Public Function GetStatusData(ByVal hDev as integer, ByRef pStatus as
STATUS_DATA) as Integer
GetStatus = TestComunication(hDev, COM_STATUS, VariantType.Null, 0, pStatus,
Len(pStatus))
End Function

The declaration of this function is

Public Declare Function TestComunication Lib "TestDll" (ByVal hDev As Long,
ByVal ComCode As Long, ByRef SendData As Long, ByVal SendDataNum As Long,
ByRef ReceiveData As STATUS_DATA, ByVal ReceiveDataNum As Long) As Long

By the way, this function is called from main every 40 ms. What do you think
causes this error message?

Thank you,


Ken Tucker [MVP]
9/16/2005 6:56:57 AM
Hi,

Your function never returns a value.

Public Function GetStatusData(ByVal hDev as integer, ByRef pStatus as
STATUS_DATA) as Integer
GetStatus = TestComunication(hDev, COM_STATUS, VariantType.Null, 0,
pStatus, Len(pStatus))
Return GetStatus
End Function


Ken
------------------
[quoted text, click to view]

AddThis Social Bookmark Button