We try to execute the following code in C# while executing against
GroupWise 7.0.3:

Parameter: GroupwareTypeLibrary.QuickMessage2 qmsg,

string classname = qmsg.ClassName;

if (classname.StartsWith("GW.MESSAGE.MAIL")) {

GroupwareTypeLibrary.Message3 fullmsg =


GroupwareTypeLibrary.Mail5 mail = (GroupwareTypeLibrary.Mail5)fullmsg;

Sometimes we get the following Exception:

Unable to cast COM object of type 'System.__ComObject' to interface type
'GroupwareTypeLibrary.Mail5'. This operation failed because the
QueryInterface call on the COM component for the interface with IID
'{E81B236E-E6AB-41B0-9219-C2467652A03B}' failed due to the following
error: No such interface supported (Exception from HRESULT: 0x80004002

Is the classname of the quickmessage and the Groupwise Version not a
sufficient condition for this cast? Under which conditions does this
cast fail?

Thanks for the help.

Best regards, Martin Schmidt.