[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Newsgroup Home]
|
[news.eclipse.platform.swt] Re: OLE Sample and 2.1 Changes
|
In the past, if you had a Variant of type VT_EMPTY and asked for the int
value, it returned 0. In 2.1 it throws an exception.
You can use Variant.getType to check for VT_EMPTY and avoid the exception.
"Scott Fairbrother" <scottf@xxxxxxxxxx> wrote in message
news:bb5ae7$5rr$1@xxxxxxxxxxxxxxxx
> What's going on with the changes to the OLE sample where the Navigate
method
> in 2.0 returned an int and now in the 2.1 sample it's a void?
>
> The pattern in 2.0 included setting a Variant and returning an int. The
> following code pattern now produces an error:
>
> Variant pVarResult = oleAutomation.invoke(dispIdMember, rgvarg,
> rgdispidNamedArgs);
>
> if (pVarResult == null)
>
> return 0;
>
> return pVarResult.getInt();
>
>