473,387 Members | 1,481 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Exceptions problem

Hi,
can anyone give me more informations on these exceptions:

1. "COM object that has been separated from its underlying RCW can not be
used."

2. "Unable to get the window handle for the 'some control' contol.
Windowless ActiveX controls are not supported"

Second exception is thrown on Dispose if the contol is created, but not
shown at all. When the control is shown then this exception is not thrown.
I don't know when the first exception shows up.

3. (Kinda related to 2.) How can i check is it some control disposed ?!
Nov 16 '05 #1
2 1915
UmmagummA,

For the first, it would mean that the wrapper has called Release on the
pointer to the interface that it is holding, decrementing its reference
count. Basically, if you pass a RCW to the static ReleaseComObject method
on the Marshal class, and then call a method on the wrapper, it will throw
this error.

For the second, some Active X controls don't create child windows in the
classic sense, rather, they handle the drawing of all the elements
themselves. In these cases, you will not be able to get window handles for
some of them. What are you trying to do here that you get that exception?
The controls in VBA in Microsoft Office (Microsoft Office Forms) are
windowless controls, for example.

There is really no way to tell if an object is disposed or not. If you
have to check this, it would indicate a flaw in your design, as you are
passing around objects which really should be just let go (after being
disposed).

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"UmmagummA" <fl***@mt.net.mk> wrote in message
news:ut**************@TK2MSFTNGP15.phx.gbl...
Hi,
can anyone give me more informations on these exceptions:

1. "COM object that has been separated from its underlying RCW can not be
used."

2. "Unable to get the window handle for the 'some control' contol.
Windowless ActiveX controls are not supported"

Second exception is thrown on Dispose if the contol is created, but not
shown at all. When the control is shown then this exception is not thrown.
I don't know when the first exception shows up.

3. (Kinda related to 2.) How can i check is it some control disposed ?!

Nov 16 '05 #2
As an addendum to what Nicholas mentioned, if you are to make sure your
COM objects are properly disposed off, try creating a new AppDomain and host
your COM objects there. When you are done using the COM object, delete the
AppDomain which will effectively delete all the resources used by it.

HTH,
-Azhagan
"UmmagummA" <fl***@mt.net.mk> wrote in message
news:ut**************@TK2MSFTNGP15.phx.gbl...
Hi,
can anyone give me more informations on these exceptions:

1. "COM object that has been separated from its underlying RCW can not be
used."

2. "Unable to get the window handle for the 'some control' contol.
Windowless ActiveX controls are not supported"

Second exception is thrown on Dispose if the contol is created, but not
shown at all. When the control is shown then this exception is not thrown.
I don't know when the first exception shows up.

3. (Kinda related to 2.) How can i check is it some control disposed ?!

Nov 16 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

33
by: Steven Bethard | last post by:
I feel like this has probably been answered before, but I couldn't find something quite like it in the archives. Feel free to point me somewhere if you know where this has already been answered. ...
26
by: OvErboRed | last post by:
I just read a whole bunch of threads on microsoft.public.dotnet.* regarding checked exceptions (the longest-running of which seems to be <cJQQ9.4419 $j94.834878@news02.tsnz.net>. My personal...
24
by: mag31 | last post by:
Is there any way to find out if a particular .net function will throw an exception without first generating the exception? I am using structured exception handling i.e. try catch finally blocks...
7
by: Kenny Cutter | last post by:
Hi group, I am quite new to exceptions in .NET and I am a bit confused of how to use the inner exceptions. Could anyone explain? Let's say I have a function that takes a double (X) that is not...
15
by: Bernard | last post by:
Hi All, I am not sure if I should be asking this question on clc or clc++. Let me try on both. I hope that this is not too trivial for the brilliant minds over here. I know that OOP questions...
22
by: Drew | last post by:
How do I know which exceptions are thrown by certain methods? For example, reading a file might throw an IO Exception, etc. In Java, the compiler won't even let you compile unless you put your...
14
by: dcassar | last post by:
I have had a lively discussion with some coworkers and decided to get some general feedback on an issue that I could find very little guidance on. Why is it considered bad practice to define a...
1
by: Anonieko | last post by:
Understanding and Using Exceptions (this is a really long post...only read it if you (a) don't know what try/catch is OR (b) actually write catch(Exception ex) or catch{ }) The first thing I...
5
by: adam.timberlake | last post by:
I've just finished reading the article below which goes into some depth about exceptions. The article was rather lucid and so I understand how to implement it all, the thing I'm having trouble with...
14
by: Rafe | last post by:
Hi, I've encountered a problem which is making debugging less obvious than it should be. The @property decorator doesn't always raise exceptions. It seems like it is bound to the class but...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.