Author Topic: Error HRESULT E_FAIL has been returned from a call to a COM component  (Read 15357 times)

0 Members and 1 Guest are viewing this topic.

sinc

  • Guest
Re: Error HRESULT E_FAIL has been returned from a call to a COM component
« Reply #30 on: July 28, 2010, 05:28:47 PM »
I think the big reason to avoid the Interops is that if you have fully-managed code, you can build one DLL (or set of DLLs), and run it on multiple releases of Autocad, on either 32-bit or 64-bit platforms, and you don't have to worry about any of the platform issues.

And of course, the .NET interface is typically faster than the COM interface.

Glenn R

  • Guest
Re: Error HRESULT E_FAIL has been returned from a call to a COM component
« Reply #31 on: July 28, 2010, 06:12:33 PM »
Where's your mistake? Apart from still using COM when I showed you in your other thread how to use PInvoke...

Hi Glenn,
About the COM usage, is that just for this case in particular? or in other words for what the OP routine is doing?

BTW, I have some large amount of code lines, that I am taking out my COM calls, so far noticed a difference in the speed, when selecting an object get all the properties, and pass those to a form (ie. tree control)... I still need the use of com objects - was thinking to probably post some of my code, but it is very specific, don't know...

So any comment you might have about COM...

Thank you Sir!  :)

Luis,

It's late and my eyes are hanging out of my head, so I'll post a more coherent reply tomorrow, which will be just my opinions, based on observations I've made over the years.

Cheers,

LE3

  • Guest
Re: Error HRESULT E_FAIL has been returned from a call to a COM component
« Reply #32 on: July 28, 2010, 06:22:09 PM »
Luis,

It's late and my eyes are hanging out of my head, so I'll post a more coherent reply tomorrow, which will be just my opinions, based on observations I've made over the years.

Cheers,
Perfect....








I see your eyes on the avatar, you are right :)

Glenn R

  • Guest
Re: Error HRESULT E_FAIL has been returned from a call to a COM component
« Reply #33 on: July 28, 2010, 06:23:55 PM »
Don't go diss'ing my avatar now... ;-)

Chat tomorrow. L8R

Glenn R

  • Guest
Re: Error HRESULT E_FAIL has been returned from a call to a COM component
« Reply #34 on: July 30, 2010, 06:16:15 AM »
Where's your mistake? Apart from still using COM when I showed you in your other thread how to use PInvoke...

Hi Glenn,
About the COM usage, is that just for this case in particular? or in other words for what the OP routine is doing?

BTW, I have some large amount of code lines, that I am taking out my COM calls, so far noticed a difference in the speed, when selecting an object get all the properties, and pass those to a form (ie. tree control)... I still need the use of com objects - was thinking to probably post some of my code, but it is very specific, don't know...

So any comment you might have about COM...

Thank you Sir!  :)

Luis,

Sorry for the delay. It was in context to the OP's question, but more generally, this is what I tend to follow:
A. Is it in the Managed API? Yes - use it; No, goto plan B
B. Can I get to it easily with PInvoke? Yes - use it; No, goto plan C
3. Can I use it through COM, taking into account how much I need it, dependencies etc. Yes - use it; No, well....redesign maybe...:D

LE3

  • Guest
Re: Error HRESULT E_FAIL has been returned from a call to a COM component
« Reply #35 on: July 31, 2010, 12:11:17 PM »
Luis,

Sorry for the delay. It was in context to the OP's question, but more generally, this is what I tend to follow:
A. Is it in the Managed API? Yes - use it; No, goto plan B
B. Can I get to it easily with PInvoke? Yes - use it; No, goto plan C
3. Can I use it through COM, taking into account how much I need it, dependencies etc. Yes - use it; No, well....redesign maybe...:D

Got it! Glenn, it makes sense :)