HighTechTalks DotNet Forums  

Help! - The callee is not available and disappeared Error Message

Dotnet Framework (Interop) microsoft.public.dotnet.framework.interop


Discuss Help! - The callee is not available and disappeared Error Message in the Dotnet Framework (Interop) forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
JerryWEC
 
Posts: n/a

Default Help! - The callee is not available and disappeared Error Message - 06-13-2007 , 02:12 PM






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



Reply With Quote
  #2  
Old   
Ben Voigt [C++ MVP]
 
Posts: n/a

Default Re: Help! - The callee is not available and disappeared Error Message - 06-14-2007 , 12:44 AM







"JerryWEC" <JerryWEC (AT) newsgroups (DOT) nospam> wrote

Quote:
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.
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.

Quote:
Please help me understand this cause and solve it!

TIA! JerryM



Reply With Quote
  #3  
Old   
JerryWEC
 
Posts: n/a

Default Re: Help! - The callee is not available and disappeared Error Message - 06-14-2007 , 11:20 AM



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



Reply With Quote
  #4  
Old   
Ben Voigt [C++ MVP]
 
Posts: n/a

Default Re: Help! - The callee is not available and disappeared Error Message - 06-14-2007 , 11:04 PM




"JerryWEC" <JerryWEC (AT) newsgroups (DOT) nospam> wrote

Quote:
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.

Quote:
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.

Quote:
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)?

Quote:
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.

Quote:
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.

Quote:
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



Reply With Quote
  #5  
Old   
JerryWEC
 
Posts: n/a

Default Re: Help! - The callee is not available and disappeared Error Message - 06-17-2007 , 03:45 PM



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__b77a 5c561934e089\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\CL A_WMWrapper.dll', Symbols loaded.

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

'VB6.EXE' (Managed): Loaded 'C:\WINDOWS\assembly\GAC_MSIL\Microsoft.VisualBasi c\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.dl l', 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__b77a 5c561934e089\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\Lo ginWin.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\CL A_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\cl a_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\CL A_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.dl l', 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\CL A_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\cl a_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__b0 3f5f7f11d50a3a\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__b 77a5c561934e089\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.OracleClie nt\2.0.0.0__b77a5c561934e089\System.Data.OracleCli ent.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.EnterpriseServi ces\2.0.0.0__b03f5f7f11d50a3a\System.EnterpriseSer vices.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

Reply With Quote
  #6  
Old   
JerryWEC
 
Posts: n/a

Default Re: Help! - The callee is not available and disappeared Error Message - 06-17-2007 , 05:48 PM



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

Reply With Quote
  #7  
Old   
Walter Wang [MSFT]
 
Posts: n/a

Default Re: Help! - The callee is not available and disappeared Error Message - 06-18-2007 , 08:53 AM



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 (wawang (AT) online (DOT) 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.


Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.