iMacros component: Calling and recursion protocol

Discussions and Tech Support related to using the iMacros Component for .NET in your applications.
Forum rules
iMacros EOL - Attention!

The renewal maintenance has officially ended for Progress iMacros effective November 20, 2023 and all versions of iMacros are now considered EOL (End-of-Life). The iMacros products will no longer be supported by Progress (aside from customer license issues), and these forums will also no longer be moderated from the Progress side.

Thank you again for your business and support.

Sincerely,
The Progress Team

Before asking a question or reporting an issue:
1. Please review the list of FAQ's.
2. Use the search box (at the top of each forum page) to see if a similar problem or question has already been addressed.
3. Try searching the iMacros Wiki - it contains the complete iMacros reference as well as plenty of samples and tutorials.
4. We can respond much faster to your posts if you include the following information: CLICK HERE FOR IMPORTANT INFORMATION TO INCLUDE IN YOUR POST
Post Reply
BGood
Posts: 19
Joined: Thu Mar 31, 2011 2:23 am

iMacros component: Calling and recursion protocol

Post by BGood » Fri Aug 19, 2011 7:22 pm

In my test integration of the iMacros component with my application, I created a class which closely follows the structure of the sample TestComponent_VB/Form1.vb. My code-behind has a new() constructor which instantiates the iMacros component and adds the control to a windows.forms.container control as follows:

#Region "iMacros"
Public Sub New()
InitializeComponent()
iim = iMacrosControl.Create("myKey")
iim.Dock = DockStyle.Fill
SplitContainer1.Panel2.Controls.Add(iim)
AddHandler iim.BrowserStatusUpdated, AddressOf iim_BrowserStatusUpdated
End Sub ...

The calling protocol I typically use for windows forms is class.show() or class.showdialog(), but because it appears that the iMacros component requires initialization via constructor, I am activating the form as follows:

Dim frm As New iMacrosForm
frm.ShowDialog()
frm.Dispose()

I have tried this several different ways, but the problem I am having is that the iMacrosForm instance runs fine the first time it is called, but after the form is closed, if the form is activated again I get the following runtime error:
System.Runtime.InteropServices.InvalidComObjectException was unhandled
Message=COM object that has been separated from its underlying RCW cannot be used.
Source=mscorlib
I have tried calling dispose() in the close event of the form and elsewhere and presume that I am invoking the iMacros form improperly. Is there some additional documentation on how to do this? Thanks.
Marcia, Tech Support

Re: iMacros component: Calling and recursion protocol

Post by Marcia, Tech Support » Mon Sep 12, 2011 7:01 am

Hello,

Thank you for pointing this out.

The fix for this issue is going to be available in the next Component release (version 7.50)
Post Reply