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