By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
449,353 Members | 1,256 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 449,353 IT Pros & Developers. It's quick & easy.

Need a COM expert

P: n/a
I'm using ITextRange::FindText Method
and it works OK but I have to code so that if the return is
not equal to S_OK means it succeeded.

Does VB.NET do some thing to the HRESULT before I get it?

Should I always assume VB.NET inverts HRESULT returns?


Jan 4 '08 #1
Share this Question
Share on Google+
2 Replies

P: n/a
>Should I always assume VB.NET inverts HRESULT returns?
Why should VB.NET invert HRESULT's? This makes no sense!
See the HRESULT Data Type Layout:
and look at the links at the bottom of the page!

See this:

and this:

Beste Grüsse / Best regards / Votre bien devoue
Kerem Gümrükcü
Microsoft Live Space:
Latest Open-Source Projects:
"This reply is provided as is, without warranty express or implied."
Jan 4 '08 #2

P: n/a
I think I know what is confusing me.

The ITextRange::FindText


BSTR bstr,
long Count,
long Flags,
long *pLength


Return Value

The method returns an HRESULT value. If the method succeeds, it returns
S_OK. If the method fails, it returns S_FALSE. For more information about
Component Object Model (COM) error codes, see Error Handling.


But I think VB is returning pLenght

If that makes sense to you I really appeciate an explanition.

The second site you mentioned says:
COM methods that regularly return two or more different success codes, such
as S_OK or S_FALSE, cannot be distinguished.

Which I don't understand

and it says:

All Visual Studio SDK interop methods are of int type. HRESULT values are
passed through the interop layer without alteration and without generating

Seems not to be what I see!

So what is confusing me (I think) is I don't know how VB converts FindText
to what looks like a Class method.

Thanks for replying

Jan 4 '08 #3

This discussion thread is closed

Replies have been disabled for this discussion.