Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

catching System.Runtime.InteropServices.COMException

0 views
Skip to first unread message

Christoph Seidel

unread,
Oct 21, 2002, 9:26:31 AM10/21/02
to
everytime a catch an outlook error of this type, i get a different
ErrorCode, message is always the same, code and environment is the same
so how shall i identify a special exception if the Errorcode always changes?


Thomas Tomiczek [MVP]

unread,
Oct 21, 2002, 9:41:08 AM10/21/02
to
THROUGH the errorcode.

See, in COM there are no error descriptions, ONLY a numeric error code (the
so called HRESULT).

You have to analyze this code.

--
Regards

Thomas Tomiczek
THONA Consulting Ltd.
(Microsoft MVP C#/.NET)
--
Still writing SQL and dealing with DataSets?
Why dont you use our EntityBroker - the most advanced o/r and business
object toolkit in town.


"Christoph Seidel" <chris66...@gmx.de> wrote in message
news:ap0vaa$qraq2$1...@ID-143718.news.dfncis.de...

Christoph Seidel

unread,
Oct 21, 2002, 10:06:26 AM10/21/02
to
Thomas Tomiczek [MVP] wrote:
> THROUGH the errorcode.

yeah, of course, but the errorcode always *changes* for the *same*
operation, really weird!

Christoph Seidel

unread,
Oct 21, 2002, 11:04:10 AM10/21/02
to
Thomas Tomiczek [MVP] wrote:
> Hm, this sounds like it is not the same error :-)

same line of code, same parameters

well, as i said: weird!


Thomas Tomiczek [MVP]

unread,
Oct 21, 2002, 10:56:52 AM10/21/02
to
Hm, this sounds like it is not the same error :-)

--
Regards

Thomas Tomiczek
THONA Consulting Ltd.
(Microsoft MVP C#/.NET)
--
Still writing SQL and dealing with DataSets?
Why dont you use our EntityBroker - the most advanced o/r and business
object toolkit in town.


"Christoph Seidel" <chris66...@gmx.de> wrote in message

news:ap11l5$qcrgq$1...@ID-143718.news.dfncis.de...

Thomas Tomiczek [MVP]

unread,
Oct 21, 2002, 11:12:56 AM10/21/02
to
Well, this does not necessary mean this.

(a) can it be that one of the parameters is a pointer and shows to random
data, thus creating different errors?
(b) can it be that the component is depending on external state?

Give details :-)

--
Regards

Thomas Tomiczek
THONA Consulting Ltd.
(Microsoft MVP C#/.NET)
--
Still writing SQL and dealing with DataSets?
Why dont you use our EntityBroker - the most advanced o/r and business
object toolkit in town.


"Christoph Seidel" <chris66...@gmx.de> wrote in message

news:ap151d$ql2ml$1...@ID-143718.news.dfncis.de...

Christoph Seidel

unread,
Oct 21, 2002, 4:05:56 PM10/21/02
to
Thomas Tomiczek [MVP] wrote:
> Well, this does not necessary mean this.
>
> (a) can it be that one of the parameters is a pointer and shows to
> random data, thus creating different errors?
> (b) can it be that the component is depending on external state?
>
> Give details :-)

LOL, i was waiting for this question :)

ok, eat this:

//items is type of Outlook.Items
//filter is a where-clause which contains a field which is not part of the
folders property collection, thus an exception is thrown
it is always the same empty folder, thus always the same items collection
(zero members) and always the same filter
try {
hits = items.Restrict(filter);
}
catch(System.Runtime.InteropServices.COMException e) {
if (!e.Message.StartsWith("The property")) throw e; //TODO: bullshit
workaround for mutating e.ErrorCode
}


Thomas Tomiczek [MVP]

unread,
Oct 22, 2002, 2:37:34 AM10/22/02
to
Bäh. Did not taste.

Have you tried asking around in the Outlook newsgroups? Just to see whether
this is an error with the object model, or with the interop layer?

--
Regards

Thomas Tomiczek
THONA Consulting Ltd.
(Microsoft MVP C#/.NET)
--
Still writing SQL and dealing with DataSets?
Why dont you use our EntityBroker - the most advanced o/r and business
object toolkit in town.


"Christoph Seidel" <chris66...@gmx.de> wrote in message

news:ap1mn3$qaada$1...@ID-143718.news.dfncis.de...

Christoph Seidel

unread,
Oct 22, 2002, 4:43:49 AM10/22/02
to
Thomas Tomiczek [MVP] wrote:
> Bäh. Did not taste.
>
> Have you tried asking around in the Outlook newsgroups? Just to see
> whether this is an error with the object model, or with the interop
> layer?

damned, you are right, it's an OL bug (feature?)


Thomas Tomiczek [MVP]

unread,
Oct 22, 2002, 5:29:33 AM10/22/02
to
:-) Thanks. At least the bitter taste in my mouth helped you :-)

Just a a suggestion for interop- try to leave the .NET groups as fast as
possible. When you are sure that the interop part works, the gsupport areas
for the products you basically interop WITH area a way better area to get
help. Like finding a workaround for this thing here.

--
Regards

Thomas Tomiczek
THONA Consulting Ltd.
(Microsoft MVP C#/.NET)
--
Still writing SQL and dealing with DataSets?
Why dont you use our EntityBroker - the most advanced o/r and business
object toolkit in town.


"Christoph Seidel" <chris66...@gmx.de> wrote in message

news:ap334b$qjnt3$1...@ID-143718.news.dfncis.de...

0 new messages