Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / Interop / November 2005

Tip: Looking for answers? Try searching our database.

Knowing when COM interop is possible

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
BGU - 11 Apr 2005 19:38 GMT
Hello,    We have a CRM system here called Pivotal eRelationship R99.  I am
writing a batch upload service to populate the CRM with data from various
sources.  Pivotal shipped a COM component in 1999 to assist with this kind
of activity.  It is an ActiveX 1.0 control module called RelOcx.  I am
trying to call it from Visual J# 2003 using COM interop.

I've had good luck with COM interop in the past, but not in this case.
Although I can instantiate a RelOcx class in my program, as soon as I call
any of the object's methods, an unhandled exception is thrown.  The methods
I have tried calling all perform quite basic operations, so nothing
unexpected *should* be taking place here.  A stack trace with a source
excerpt is below.

Here is my question: it seems the use of older components from .NET is
possible in some instances but not in others.  How can the programmer know
when COM interop is possible?

The closest answer I can find lives at
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cp
conexposingcomcomponentstonetframework.asp
.
The editors write, "An ideal [old] component has a primary interop assembly
and conforms tightly to the programming standards imposed by COM."  I'm not
sure how I would know whether that is the case here.

Thanks,
BGU

************

Server Error in '/Exp7' Application.

Catastrophic failure
Description: An unhandled exception occurred during the execution of the
current
web request. Please review the stack trace for more information about the
error
and where it originated in the code.

Exception Details: System.Runtime.InteropServices.COMException: Catastrophic
failure

Source Error:

Line 22:  {
Line 23:   RelationshipCacheClass c = new RelationshipCacheClass() ;
Line 24:   c.set_DisplayUI( true ) ;
Line 25:   Label1.set_Text( c.getClass().toString() ) ;

Source File: c:\inetpub\wwwroot\Exp7\WebForm1.aspx.jsl    Line: 24

Stack Trace:

[COMException (0x8000ffff): Catastrophic failure]
  System.RuntimeType.ForwardCallToInvokeMember(String memberName,
BindingFlags flags, Object target, Int32[] aWrapperTypes, MessageData&
msgData) +463
  RELOCXLib.RelationshipCacheClass.set_DisplayUI(Boolean ) +0
  Exp7.WebForm1.Page_Load(Object sender, EventArgs e) in
c:\inetpub\wwwroot\Exp7\WebForm1.aspx.jsl:24
  System.Web.UI.Control.OnLoad(EventArgs e) +67
  System.Web.UI.Control.LoadRecursive() +35
  System.Web.UI.Page.ProcessRequestMain() +750

Version Information: Microsoft .NET Framework Version:1.1.4322.2032; ASP.NET
Version:1.1.4322.2032
Ted - 14 Apr 2005 02:28 GMT
BGU,

I have the same problem. What I had to do was do a sleep for enough to
ensure that the assembly was loaded. If I try to access it before it is
loaded, I get an exception.

I am also looking for a programmitcal way to check if the assembly is loaded
before I use it.

Ted

> Hello,    We have a CRM system here called Pivotal eRelationship R99.  I
> am writing a batch upload service to populate the CRM with data from
[quoted text clipped - 62 lines]
> ASP.NET
> Version:1.1.4322.2032
=?UTF-8?Q?"Nicolas_Bourr=C3=A9"<nbourre@hotmail.com>?= - 14 Nov 2005 15:29 GMT
Hi,
I have the same problem, but couldn't make it through.  What do you exactly
mean by "do a sleep"?

Thank you
fdeckerNOSPAMM@aol.com - 14 Nov 2005 19:00 GMT
Have you tried the "begininit" and "endinit" statements in the system
namespace?  Make a regular MFC application, then take any ActiveX and
drop it on a form.  The importer will run and create your AXabcInterop
assembly and the rest.  Now look at the form designer code.  It shows
you how microsoft makes sure the component is instantiated before
properties to it try to get set.

Fred

Nicolas Bourré wrote:
> Hi,
> I have the same problem, but couldn't make it through.  What do you exactly
> mean by "do a sleep"?
>
> Thank you

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.