Discussion:
Help! - The callee is not available and disappeared Error Message
(too old to reply)
JerryWEC
2007-06-13 18:12:38 UTC
Permalink
ATTN: COM Experts

I have been getting this error message and have post a few times but still
don't have any answers and I can't find any on the www.

*** Message:
The callee (server [not server application]) is not available and
disappeared; all connections are invalid. The call may have executed.
(Exception from HRESULT: 0x80010007 (RPC_E_SERVER_DIED))

Note: This appears to happen when raising an event from VB.net 2005 object
to a COM (VB6) client application.

Please help me understand this cause and solve it!

TIA! JerryM
Ben Voigt [C++ MVP]
2007-06-14 04:44:55 UTC
Permalink
Post by JerryWEC
ATTN: COM Experts
I have been getting this error message and have post a few times but still
don't have any answers and I can't find any on the www.
The callee (server [not server application]) is not available and
disappeared; all connections are invalid. The call may have executed.
(Exception from HRESULT: 0x80010007 (RPC_E_SERVER_DIED))
Note: This appears to happen when raising an event from VB.net 2005 object
to a COM (VB6) client application.
When raising events, the client and server switch roles. The event source
is the client of the event sink.

When your subscribed object is destroyed, it should unsubscribe itself from
any and all events. In-process, the event subscription would hold a
ref-count that should be enough to keep the sink alive. Out-of-process, it
is possible for the user to exit the app overriding the ref-count.
Post by JerryWEC
Please help me understand this cause and solve it!
TIA! JerryM
JerryWEC
2007-06-14 15:20:48 UTC
Permalink
Ben, thanks for responding!!

A B
C

_____VB6___ _________________same dll
assembly_______________

************ ****************
******************
* VB6 Client * -----> * .net Wrapper * ---------> * .net
class with main *
* App * * object to expose *
* code. *
************ * to COM VB *
******************
***************

************ ********************
********************
* * * Event from main code *
* <- Event Raised here *
* * * rcvd event and *
* *
* * * reraises another event *
* *
* * * to VB6 app and *
* *
* * * At this point the error *
* *
* * * occurs goes to a error *
* *
* * * catch block. *
* *
************ ********************
*********************

I don't understand how switching roles occurs. I am only sending events
from one .net wrapper class to the VB6 application.
My VB6 application contains an instantance of the .net object (dll) and is
receiving events from the object to VB6. As far as
I know I'm not destorying any of my objects. My main object in VB6 is
created and I have a global variable holding it until
the application ends. This is an RPC error and I'm not doing anything with
the object like setting it to Nothing in VB. I am settting another object
to it like Set WM = WMGirth then maybe later Set WM = WMSeal. WMGirth and
WMSeal are my main objects in
VB6 but they are the objects from may .net assembly that are exposed to COM
using COM InterOP attributes. The objects
in VB6 are declared using With Events. I have other events that are being
raised with no issues. Originally the event seem to work
fine using buttons. But now I'm trying to system testing using Timers and
PLC interfaces that may be using cpu time and interrupts, etc...
Now I'm getting the error message in debug mode and when not in debug
(attached) events seem to take a long time.

This happens right at the point I'm raising the event to COM from my .net
wrapper class that has the COM attributes.

I'm using traditional good programming techiques in VB6 and should be doing
what I need to on the .net side. I just don't understand
how you raise an event from .net to COM and it blows up???

One other thing the point where I raise the event in my main code is in an
event handler from a TCP/IP communication object (.net). When this error
happens I handle the error to record it and then the original event handler
is called again.

I'm sorry I'm really lost. The VB6 client application is creating these
WMGrith and WMSeal object using early binding and I'm not destorying them
until the end. I believe the .net object is running in-process but I'm not
sure. When you embed a .net object in VB6 does it not run in-process?

JerryM
Ben Voigt [C++ MVP]
2007-06-15 03:04:19 UTC
Permalink
Post by JerryWEC
Ben, thanks for responding!!
A B C
_____VB6___ _________________same dll
assembly_______________
************ **************** ******************
* VB6 Client * -----> * .net Wrapper * ---------> * .net
class with main *
* App * * object to expose * * code.
*
************ * to COM VB * ******************
***************
************ ******************** ********************
* * * Event from main code * * <-
Event Raised here *
* * * rcvd event and * *
*
* * * reraises another event * *
*
* * * to VB6 app and * *
*
* * * At this point the error * *
*
* * * occurs goes to a error * *
*
* * * catch block. * *
*
************ ******************** *********************
I don't understand how switching roles occurs. I am only sending events
from one .net wrapper class to the VB6 application.
My VB6 application contains an instantance of the .net object (dll) and is
Ok, that's reasonable.
Post by JerryWEC
receiving events from the object to VB6. As far as
Not really. You don't receive events. When you use a component from VB, a
control or such, you have an interface pointer to that object, through which
you can call its methods and properties. A component that has events
declares a second interface but does not implement it. Instead, the user
(in your case VB) adds that interface to one of its objects, called an event
sink, and gives the interface pointer to the component, the event source.

Now the component holds the pointer to the user. Thus the normal roles are
reversed.
Post by JerryWEC
I know I'm not destorying any of my objects. My main object in VB6 is
created and I have a global variable holding it until
the application ends. This is an RPC error and I'm not doing anything
with the object like setting it to Nothing in VB. I am settting another
object to it like Set WM = WMGirth then maybe later Set WM = WMSeal.
WMGirth and WMSeal are my main objects in
Both of these have a long lifetime that you know has not ended? Have you
put logging code in the destructor (I think it's called Terminate in VB)?
Post by JerryWEC
VB6 but they are the objects from may .net assembly that are exposed to
COM using COM InterOP attributes. The objects
in VB6 are declared using With Events. I have other events that are being
raised with no issues. Originally the event seem to work
fine using buttons. But now I'm trying to system testing using Timers and
PLC interfaces that may be using cpu time and interrupts, etc...
That suggests a threading problem. Perhaps your .NET component and VB
aren't agreed on whether the objects are single-threaded,
apartment-threaded, or free-threaded? Try using Control.Invoke in .NET to
raise the message.
Post by JerryWEC
Now I'm getting the error message in debug mode and when not in debug
(attached) events seem to take a long time.
This happens right at the point I'm raising the event to COM from my .net
wrapper class that has the COM attributes.
I'm using traditional good programming techiques in VB6 and should be
doing what I need to on the .net side. I just don't understand
how you raise an event from .net to COM and it blows up???
One other thing the point where I raise the event in my main code is in an
event handler from a TCP/IP communication object (.net). When this error
happens I handle the error to record it and then the original event
handler is called again.
I'm sorry I'm really lost. The VB6 client application is creating these
WMGrith and WMSeal object using early binding and I'm not destorying them
How about the object declaring WithEvents references? Is that a code module
or a class module? Does an instance of the VB class possibly get destroyed.
It is decidedly *not* the .NET instances that are dying, it is the VB object
that is inaccessible when the .NET code tries to call the event handlers.
Post by JerryWEC
until the end. I believe the .net object is running in-process but I'm
not sure. When you embed a .net object in VB6 does it not run in-process?
JerryM
JerryWEC
2007-06-17 19:45:37 UTC
Permalink
Ben and/or everyone:

Here is some debugging output in VB2005... Maybe this new message in the debug window will help explain my issue. Some of the lines are debug.print() statements that I have put in my code and others are written there by the IDE...

'VB6.EXE' (Managed): Loaded 'C:\WINDOWS\assembly\GAC_32\mscorlib\2.0.0.0__b77a5c561934e089\mscorlib.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.

'VB6.EXE' (Managed): Loaded 'I:\DEV\CLA_WeldMonitor\CLA_WMWrapper\bin\Debug\CLA_WMWrapper.dll', Symbols loaded.

'VB6.EXE' (Managed): Loaded 'I:\DEV\CLA_WeldMonitor\CLA_WMWrapper\bin\Debug\CLA_WeldMonitor.dll', Symbols loaded.

'VB6.EXE' (Managed): Loaded 'C:\WINDOWS\assembly\GAC_MSIL\Microsoft.VisualBasic\8.0.0.0__b03f5f7f11d50a3a\Microsoft.VisualBasic.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.

'VB6.EXE' (Managed): Loaded 'C:\WINDOWS\assembly\GAC_MSIL\System.Windows.Forms\2.0.0.0__b77a5c561934e089\System.Windows.Forms.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.

'VB6.EXE' (Managed): Loaded 'C:\WINDOWS\assembly\GAC_MSIL\System\2.0.0.0__b77a5c561934e089\System.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.

'VB6.EXE' (Managed): Loaded 'C:\WINDOWS\assembly\GAC_MSIL\System.Drawing\2.0.0.0__b03f5f7f11d50a3a\System.Drawing.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.

'VB6.EXE' (Managed): Loaded 'I:\DEV\CLA_WeldMonitor\CLA_WMWrapper\bin\Debug\LoginWin.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.

'VB6.EXE' (Managed): Loaded 'I:\DEV\CLA_WeldMonitor\CLA_WMWrapper\bin\Debug\CLA_Communications.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.

'VB6.EXE' (Managed): Loaded 'C:\WINDOWS\assembly\GAC_MSIL\Accessibility\2.0.0.0__b03f5f7f11d50a3a\Accessibility.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.

'VB6.EXE' (Managed): Loaded 'I:\DEV\CLA_WeldMonitor\CLA_WMWrapper\bin\Debug\cla_TCPClient.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.

'VB6.EXE' (Managed): Loaded 'I:\DEV\CLA_WeldMonitor\CLA_WMWrapper\bin\Debug\CLA_Logging.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.

'VB6.EXE' (Managed): Loaded 'C:\WINDOWS\assembly\GAC_MSIL\System.Configuration\2.0.0.0__b03f5f7f11d50a3a\System.Configuration.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.

'VB6.EXE' (Managed): Loaded 'C:\WINDOWS\assembly\GAC_MSIL\System.Xml\2.0.0.0__b77a5c561934e089\System.Xml.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.

'VB6.EXE' (Managed): Loaded 'I:\DEV\CLA_WeldMonitor\CLA_WMWrapper\bin\Debug\CLA_SerialPort.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.

'VB6.EXE' (Managed): Loaded 'I:\DEV\CLA_WeldMonitor\CLA_WMWrapper\bin\Debug\cla_TCPListener.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.

'VB6.EXE' (Managed): Loaded 'C:\WINDOWS\assembly\GAC_32\System.Web\2.0.0.0__b03f5f7f11d50a3a\System.Web.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.

'VB6.EXE' (Managed): Loaded 'C:\WINDOWS\assembly\GAC_32\System.Data\2.0.0.0__b77a5c561934e089\System.Data.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.

'VB6.EXE' (Managed): Loaded 'C:\WINDOWS\assembly\GAC_32\System.Data.OracleClient\2.0.0.0__b77a5c561934e089\System.Data.OracleClient.dll', No symbols loaded.

'VB6.EXE' (Managed): Loaded 'C:\WINDOWS\assembly\GAC_MSIL\System.Web.Services\2.0.0.0__b03f5f7f11d50a3a\System.Web.Services.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.

'VB6.EXE' (Managed): Loaded 'C:\WINDOWS\assembly\GAC_32\System.Transactions\2.0.0.0__b77a5c561934e089\System.Transactions.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.

'VB6.EXE' (Managed): Loaded '3rzo3oa0', No symbols loaded.

'VB6.EXE' (Managed): Loaded 'C:\WINDOWS\assembly\GAC_32\System.EnterpriseServices\2.0.0.0__b03f5f7f11d50a3a\System.EnterpriseServices.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.

MasterReset: Set RodInProcess = False

StartWMProcess: Set RodInProcess = True

The thread '<No Name>' (0x6d0) has exited with code 0 (0x0).

ProcessWeldSummary[PASS]: Set RodInProcess = False

WeldOperationComplete: Set RodInProcess = False

MasterReset: Set RodInProcess = False

StartWMProcess: Set RodInProcess = True

DeviceDataReceived RodInProcess: True (Good here... I'm receiving data from a TCP/IP comm object) (Within Dot Net object handling comm event)

Calling ProcessWeldSummary(data) (within the preceding event handler I call this method) (Within Dot Net object)

DeviceDataReceived RodInProcess: False (<--- Lost my RodInProcess Flag setting ???) (Within Dot Net object)

The thread '<No Name>' (0x12d4) has exited with code 0 (0x0). (don't know what thread this is???)

WM RaiseEvent: MessageOccurred (Normal raising event from WM object to WMWrapper object - Informational message because flag change routes code to this event to inform calling application of a message (Data) sent in wrong mode! This is because some thing has changed my RodInProcess flag)

WMWrapper RaiseEvent: Message_Occurred (Normal - Re-Rasing event from WM to WMWrapper) (WMWrapper is a class with COM attributes to expose to the VB6 client application)

A first chance exception of type 'System.Runtime.InteropServices.COMException' occurred in mscorlib.dll

WMWrapper RaiseEvent: WrapperErrorOccurred

A first chance exception of type 'System.Runtime.InteropServices.COMException' occurred in mscorlib.dll

ProcessException: The callee (server [not server application]) is not available and disappeared; all connections are invalid. The call may have executed. (Exception from HRESULT: 0x80010007 (RPC_E_SERVER_DIED)) (This is the first time I see the COM exception in my code! Then werd things start to happen in my code like the original DeviceDataReceived event handler is refired! yes it looks like it's refired again one or more time before it is successful! )

A first chance exception of type 'System.Runtime.InteropServices.COMException' occurred in mscorlib.dll

DeviceDataReceived RodInProcess: False

WM RaiseEvent: MessageOccurred

WMWrapper RaiseEvent: Message_Occurred

A first chance exception of type 'System.Runtime.InteropServices.COMException' occurred in mscorlib.dll

WMWrapper RaiseEvent: WrapperErrorOccurred

A first chance exception of type 'System.Runtime.InteropServices.COMException' occurred in mscorlib.dll

ProcessException: The callee (server [not server application]) is not available and disappeared; all connections are invalid. The call may have executed. (Exception from HRESULT: 0x80010007 (RPC_E_SERVER_DIED))

A first chance exception of type 'System.Runtime.InteropServices.COMException' occurred in mscorlib.dll

ProcessWeldSummary[PASS]: Set RodInProcess = False


Note: It looks like this "A first chance exception of type 'System.Runtime.InteropServices.COMException' occurred in mscorlib.dll is what is occurring or the threading issue?. The IDE is putting this "A first chance.." message and the "The callee is not available and disappeared.." message in to the output window. WM messages and RodInProcess message are debug.print messages.

Help is requested from all threading and COM InterOp experts! I have read something about this "first chance" message before but can't remember. If you have any ideas before I do please send them my way!

TIA! JerryM
JerryWEC
2007-06-17 21:48:35 UTC
Permalink
Ok, I'm providing more info:

Under Debug|Exceptions, I de-selected the System.Runtime.InteropServices' User-unhandled checkbox (unchecked). This did not seem to help.
Under Tools|Options|Debugging|General, I have "Enable Just My Code (Managed only) checked.

The IDE has put some Debugger attributes in some of the resource files but nothing looks wrong here.

One Question:

I'm wondering if the are some threading or appartment threading attribute(s) I need to add to my .net code to interoperate with the VB6 COM client application. (???)

TIA! JerryM
Walter Wang [MSFT]
2007-06-18 12:53:37 UTC
Permalink
Hi Jerry,

What Ben suggested is one possible cause that the VB6 object which is
handling the event raised from .NET side might be closed before notifying
the .NET side correctly, when the .NET side raises the event again, it
might cause this exception. However, there may have other possiblities.
Without live debugging and have full access to the source code, it's hard
to tell such issue.

If you don't want to contact our Customer Support and Service (which
provides dump analysis or live debugging), you will need to find a way to
reproduce the issue and post the reproducible project here for further
troubleshooting.

Regards,
Walter Wang (***@online.microsoft.com, remove 'online.')
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.
Continue reading on narkive:
Search results for 'Help! - The callee is not available and disappeared Error Message' (Questions and Answers)
3
replies
every couple of minutes, there is a message box that always appear with the header, SVCHOST?
started 2007-05-06 18:36:01 UTC
computers & internet
Loading...