I am getting an occasional System.OverflowException with msg "Overflow" in a .NET call to a VB6 DLL COM server.
The exception seems to be happening somewhere in the transition from COM to .NET:
- The top of the stack is the COM call itself, at ComClient.VBComClass.ApplicationState()
- The VB6 ErrorHandler code is not executed, which means that the VB6 function exited normally
Is there a value or condition of a VB6 Long that would overflow a .NET int?
Code snippets:
.NET COM Client:
VBCom comObj = new VBCom();
int appState;
appState = comObj.ApplicationState();
.NET imported COM interface:
[DispId(1610809347)]
int ApplicationState();
VB6 DLL COM Server:
Public Function ApplicationState() As Long
On Error GoTo ErrorHandler
ApplicationState = {...call into another VB6 application...}
Exit Function
ErrorHandler:
ApplicationState = -1
RaiseEvent ErrorHandled("ApplicationState", Err, Error(Err))
End Function